This commit is contained in:
DengDai
2025-12-08 14:47:24 +08:00
commit 644b5aaaf8
21 changed files with 1543 additions and 0 deletions

26
Dockerfile Normal file
View File

@@ -0,0 +1,26 @@
# 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"]