animeic 2 years ago
parent
commit
1def75c244
3 changed files with 18 additions and 5 deletions
  1. 9 4
      Dockerfile
  2. 1 1
      src/main.py
  3. 8 0
      src/requirements.txt

+ 9 - 4
Dockerfile

@@ -4,12 +4,17 @@ RUN apt-get update && \
     apt-get install -y ffmpeg libsm6 libxext6 && \
     apt-get remove --purge -y && rm -rf /var/lib/apt/lists/*
 # RUN pip install python-multipart
-RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple && \
-    pip install diskcache==5.2.1 fastapi==0.65.2 pymilvus==2.1.0 towhee==0.8.0 uvicorn==0.13.4 protobuf==3.20.2 opencv-python==4.6.0.66 torch==1.12.1 torchvision==0.13.1 Pillow==9.2.0 timm==0.6.7 python-multipart && \
-    pip cache purge
+# RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple && \
+#     pip install python-multipart && \
+#     pip install diskcache==5.2.1 fastapi==0.65.2 pymilvus==2.1.0 towhee==0.8.0 uvicorn==0.13.4 protobuf==3.20.2 opencv-python==4.6.0.66 torch==1.12.1 torchvision==0.13.1 Pillow==9.2.0 timm==0.6.7 &&\
+#     pip cache purge
+
+
 
 WORKDIR /app/src
-COPY . /app
+ADD . /app
+
+RUN pip install -r requirements.txt
 
 EXPOSE 5000
 

+ 1 - 1
src/main.py

@@ -143,7 +143,7 @@ async def delete_record(table_name: str = None,partition_name: str=None,im_hash:
         # (insert count: 0, delete count: 1, upsert count: 0, timestamp: 439903119803940865, success count: 0, err count: 0)
         res = do_delete(table_name,partition_name,expr,MILVUS_CLI)
         # print(res.succ_count)
-        return {'status': True}
+        return {'status': True,'msg': "success"}
     except Exception as e:
         LOGGER.error(e)
         return {'status': False, 'msg': e}

+ 8 - 0
src/requirements.txt

@@ -0,0 +1,8 @@
+diskcache==5.4.0
+fastapi==0.93.0
+pydantic==1.10.5
+pymilvus==2.2.1
+starlette==0.25.0
+towhee==0.9.0
+towhee.models==0.9.0
+uvicorn==0.20.0