Files
TJWaterServerBinary/Dockerfile
T
2026-06-09 18:18:22 +08:00

24 lines
652 B
Docker

FROM condaforge/miniforge3:latest
WORKDIR /app
# 安装 Python 3.12 和 pymetis (通过 conda-forge 避免编译问题)
RUN mamba install -y python=3.12 pymetis && \
mamba clean -afy
COPY requirements.txt .
RUN pip install uv
RUN uv pip install --system --no-cache-dir -r requirements.txt
# 将代码放入子目录 'app',临时数据目录运行时创建。
# db_inp 和 .env 都不应依赖 Git 跟踪或被烘焙进镜像。
COPY app ./app
RUN mkdir -p ./db_inp
# 设置 PYTHONPATH 以便 uvicorn 找到 app 模块
ENV PYTHONPATH=/app
EXPOSE 8000
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "4"]