Files
2026gaokaozhiyuan/deploy/backend/Dockerfile
T
simon b6df028839 v1.0.0 高考志愿门户完整修复
变更摘要:
- [fix] 清理根目录 index.html 遗留代码(questionnaire-error + retryLoad 移除)
- [fix] 副标题同步更新为自估591分 + 候选志愿546条数据校准
- [fix] 页脚注入版本号 v1.0.0
- [fix] 部署版 index.html: 取消家长标签,统一 filler-tianheng
- [fix] Dashboard 文案修正(4份→2份线上问卷)
- [fix] 清理冗余部署脚本(v1-v4归档至 archived_scripts/)
- [fix] 等效位次工具纳入 deploy 目录
- [chore] .gitignore 初始化
- [init] Git 仓库初始化
2026-06-24 13:11:34 +08:00

29 lines
894 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.
# ============================================================
# Flask 后端 Dockerfile
# 基于 Python 3.12 Alpine(精简镜像,约 50MB
# ============================================================
FROM python:3.12-alpine
# 设置工作目录
WORKDIR /app
# 先复制依赖文件(利用 Docker 缓存层,代码改动时不用重装依赖)
COPY requirements.txt .
# 安装 Python 依赖
# --no-cache-dir: 不缓存 pip 包,减小镜像体积
RUN pip install --no-cache-dir -r requirements.txt
# 复制应用代码
COPY . .
# 创建数据目录(SQLite 数据库文件存放位置)
RUN mkdir -p /app/data
# 暴露端口(Flask 默认 5000
EXPOSE 5000
# 启动命令:初始化数据库 + 启动 Flask
# waitress-serve 是生产级 WSGI 服务器,比 flask run 更稳定
CMD ["sh", "-c", "python seed_data.py && python -m flask run --host=0.0.0.0 --port=5000"]