Przeglądaj źródła

optimized the Dockerfile

chenhaiyang 1 rok temu
rodzic
commit
57616ffc0d
1 zmienionych plików z 4 dodań i 3 usunięć
  1. 4 3
      Dockerfile

+ 4 - 3
Dockerfile

@@ -1,4 +1,4 @@
-FROM python:3.10-slim
+FROM python:3.10
 
 WORKDIR /code
 
@@ -6,8 +6,9 @@ COPY ./requirements.txt /code/requirements.txt
 COPY ./app /code/app
 COPY .env_pro /code/.env
 
-RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt -i https://mirrors.aliyun.com/pypi/simple/ && \
-    mkdir -p /code/ml_models
+RUN pip install --upgrade pip -i  https://mirrors.aliyun.com/pypi/simple/
+RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
+RUN mkdir -p /code/ml_models
 
 ENV PYTHONPATH=/code
 ENV TZ=Asia/Shanghai