add docker

This commit is contained in:
Julian Freeman
2025-10-18 15:34:41 -04:00
parent 4348671562
commit b4ee793b6f
7 changed files with 221 additions and 9 deletions

22
Dockerfile Normal file
View File

@@ -0,0 +1,22 @@
# 使用官方 Python 镜像作为基础
FROM python:3.12-slim
# 设置工作目录
WORKDIR /app
# 将你的项目文件复制到工作目录
COPY . .
# 安装依赖
# --no-cache-dir: 不存储缓存,保持镜像小巧
# --upgrade pip: 升级 pip
# -r requirements.txt: 从文件安装
RUN pip install --no-cache-dir --upgrade pip -r requirements.txt
RUN chmod +x /app/start.sh
# 暴露 Gunicorn 运行的端口
EXPOSE 8000
# 容器启动时运行的命令
CMD ["/app/start.sh"]