refactor: 重构后端结构并迁移前端到 Vue3
This commit is contained in:
+25
-23
@@ -2,30 +2,37 @@
|
||||
.git
|
||||
.gitignore
|
||||
|
||||
# Python
|
||||
__pycache__
|
||||
# Python cache and virtual environments
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
*.so
|
||||
.Python
|
||||
.env
|
||||
.venv
|
||||
.venv/
|
||||
venv/
|
||||
ENV/
|
||||
dist/
|
||||
env/
|
||||
|
||||
# IDE
|
||||
.idea/
|
||||
.vscode/
|
||||
*.swp
|
||||
*.swo
|
||||
# Frontend local artifacts
|
||||
frontend/node_modules/
|
||||
frontend/dist/
|
||||
frontend/.vite/
|
||||
|
||||
# Cache and logs
|
||||
# Runtime and package output
|
||||
cache/
|
||||
logs/
|
||||
*.log
|
||||
dist/
|
||||
uploads/
|
||||
CapacityReportData/
|
||||
# Docker
|
||||
error.log
|
||||
*.log
|
||||
|
||||
# Build helper output
|
||||
build/temp/
|
||||
|
||||
# Local-only files
|
||||
.env
|
||||
.env.local
|
||||
auth.ini
|
||||
|
||||
# Deployment files copied separately by build.py
|
||||
docker-compose*.yml
|
||||
Dockerfile*
|
||||
.dockerignore
|
||||
@@ -33,18 +40,13 @@ Dockerfile*
|
||||
# MySQL data
|
||||
mysql/
|
||||
|
||||
# Build directory (exclude build files from image)
|
||||
build/
|
||||
|
||||
# Temporary files
|
||||
# Temporary and OS files
|
||||
*.tmp
|
||||
*.temp
|
||||
.temp/
|
||||
|
||||
# OS files
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# Documentation
|
||||
# Documentation is not required in the runtime image.
|
||||
*.md
|
||||
!README.md
|
||||
|
||||
+14
-12
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user