Dockerfile 519 B

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