Files
PTGen/Dockerfile
DengDai 644b5aaaf8 init
2025-12-08 14:47:24 +08:00

27 lines
626 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Dockerfile
# 1. 使用官方 Python 基础镜像
FROM python:3.11-slim
# 2. 设置环境变量
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# 3. 设置工作目录
WORKDIR /app
# 4. 复制依赖文件并安装
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# 5. 复制所有项目文件到工作目录
COPY . .
# 6. 暴露端口
EXPOSE 8000
# 7. 启动命令
# CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
# 使用python启动以支持命令行参数
CMD ["python", "main.py", "--host", "0.0.0.0", "--port", "8000", "--config", "/app/configs/config.yaml"]