签入版本
CI / lint (push) Canceled after 0s
CI / test (push) Canceled after 0s

This commit is contained in:
2026-09-16 10:08:07 +08:00
commit fda0fe1a53
820 changed files with 97186 additions and 0 deletions
+44
View File
@@ -0,0 +1,44 @@
# ======================================================================
# 多阶段构建:Stage 1 构建依赖 -> Stage 2 运行
# ======================================================================
FROM python:3.12-slim AS builder
WORKDIR /build
# 复制依赖清单
COPY pyproject.toml poetry.lock* ./
# 安装 poetry 并导出 requirements
RUN pip install --no-cache-dir poetry \
&& poetry export -f requirements.txt -o requirements.txt --without-hashes
# ======================================================================
FROM python:3.12-slim AS runtime
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
TZ=Asia/Shanghai
WORKDIR /data/apps
# 安装运行依赖
COPY --from=builder /build/requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
# 复制项目文件
COPY src ./src
COPY app.py ./
COPY alembic ./alembic
COPY alembic.ini ./
COPY .env.example ./.env
COPY scripts ./scripts
COPY templates ./templates
COPY static ./static
# 创建运行时目录
RUN mkdir -p uploads logs
EXPOSE 8041
# 启动应用
CMD ["python", "app.py"]