chore: 首次纳入版本控制(审查前基线,v1.2.0)

This commit is contained in:
errortopic
2026-11-18 20:13:37 +08:00
commit f7b28e1740
441 changed files with 31220 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
# 错题毕业 · 小学版后端镜像
#
# 只依赖 Python 标准库,所以不用 pip install —— 这既是当时的限制,也成了优点:
# 镜像 150MB 左右、构建 10 秒、没有供应链风险。
#
# 注意:Linux 上没有 Windows OCR,拍照识题会走 OCR_HTTP_URL(见 deploy/README.md)。
FROM python:3.12-slim
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
TZ=Asia/Shanghai
WORKDIR /app
# 只拷运行需要的东西:接口、工作台页面、品牌标
COPY backend ./backend
COPY prototype ./prototype
COPY brand ./brand
# 数据目录(SQLite + 上传的卷子照片)挂卷,不要写进镜像
RUN mkdir -p /app/data/uploads
EXPOSE 8000
HEALTHCHECK --interval=30s --timeout=4s --start-period=5s --retries=3 \
CMD python -c "import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://127.0.0.1:8000/api/health',timeout=3).status==200 else 1)"
CMD ["python", "-m", "backend.app", "--host", "0.0.0.0", "--port", "8000"]