refactor: 重构后端结构并迁移前端到 Vue3

This commit is contained in:
2026-05-15 11:46:21 +08:00
parent 9107378fcc
commit 9c5a5a54c6
165 changed files with 5057 additions and 62710 deletions
+14 -12
View File
@@ -1,5 +1,16 @@
# CapacityReport Dockerfile
# 容量报表处理系统 - 用于内网离线部署
# 内网离线部署镜像,前端在镜像构建阶段编译后交给 FastAPI 托管。
FROM node:22-slim AS frontend-build
WORKDIR /frontend
COPY frontend/package*.json ./
RUN npm ci
COPY frontend/ ./
RUN npm run build
FROM python:3.13.11-slim
@@ -8,34 +19,25 @@ LABEL description="容量报表处理系统"
WORKDIR /app
# 安装系统依赖
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
libmariadb-dev \
curl \
&& rm -rf /var/lib/apt/lists/*
# 先复制依赖文件(利用缓存)
COPY requirements.txt ./
# 安装 Python 依赖
RUN pip install --no-cache-dir -r requirements.txt
# 创建目录
RUN mkdir -p /var/log/supervisor /var/run /app/cache /app/static/lib
RUN mkdir -p /var/log/supervisor /var/run /app/cache
# 复制应用代码
COPY . .
COPY --from=frontend-build /frontend/dist /app/frontend/dist
# 设置启动脚本权限
RUN chmod +x /app/start.sh 2>/dev/null || true
# 暴露端口
EXPOSE 9081
# 健康检查
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
CMD curl -f http://localhost:9081/health || exit 1
# 启动命令
CMD ["supervisord", "-c", "/app/supervisord.conf"]