Dockerfile 517 B

123456789101112131415161718
  1. FROM python:3.10
  2. WORKDIR /code
  3. COPY ./requirements.txt /code/requirements.txt
  4. COPY ./app /code/app
  5. COPY .env_pro /code/.env
  6. RUN pip install --upgrade pip -i https://mirrors.aliyun.com/pypi/simple/
  7. RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
  8. RUN mkdir -p /code/ml_models
  9. ENV PYTHONPATH=/code
  10. ENV TZ=Asia/Shanghai
  11. EXPOSE 8002
  12. CMD ["uvicorn", "app.main:app", "--root-path", "/env-py", "--log-level", "info", "--host", "0.0.0.0", "--port", "8002"]