refactor: 统一运行/编译脚本为 scripts/ 下纯 Python(自动 venv,傻瓜式)
新增 _env.py 共享工具与 dev/run/tauri_dev/build_server/build_tauri/build_docker/clean 脚本,
删除旧 build.{sh,ps1,bat}、根 run.bat/debug.bat/start.sh/dev.py、supervisord.conf、packaging/Dockerfile,
Docker 改以根 Dockerfile 为准并重写 compose(/data 卷)。
This commit is contained in:
@@ -1,44 +0,0 @@
|
||||
# CapacityReport Dockerfile
|
||||
# The frontend is built in a Node stage and served by the FastAPI runtime.
|
||||
|
||||
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
|
||||
|
||||
LABEL maintainer="CapacityReport"
|
||||
LABEL description="CapacityReport processing service"
|
||||
|
||||
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 ./
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
RUN mkdir -p /var/log/supervisor /var/run /app/cache
|
||||
|
||||
COPY app ./app
|
||||
COPY Configure.json ReportScript.sql start.sh supervisord.conf ./
|
||||
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"]
|
||||
@@ -6,14 +6,10 @@ services:
|
||||
ports:
|
||||
- "9081:9081"
|
||||
volumes:
|
||||
- ./cache:/app/cache
|
||||
- ./Configure.json:/app/Configure.json
|
||||
- ./ReportScript.sql:/app/ReportScript.sql
|
||||
- ./logs:/var/log/supervisor
|
||||
- capacity-data:/data
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
- PYTHONUNBUFFERED=1
|
||||
- SUPERVISOR_ENABLED=1
|
||||
depends_on:
|
||||
capacity-mysql:
|
||||
condition: service_healthy
|
||||
@@ -60,3 +56,5 @@ networks:
|
||||
volumes:
|
||||
capacity-mysql-data:
|
||||
driver: local
|
||||
capacity-data:
|
||||
driver: local
|
||||
|
||||
Reference in New Issue
Block a user