Files
ctms/docker-compose.dev.yaml
T
Cheng Zhou 44db5db838
Client Quality Gates / Shared client and Web (push) Has been cancelled
Client Quality Gates / macOS Desktop (push) Has been cancelled
功能(文档与桌面):完善文件预览下载与客户端构建基线
- 保存文档版本原始文件名,规范下载响应并持久化上传目录\n- 增加 PDF.js 预览、桌面保存打开流程及统一错误反馈\n- 统一 Node.js 22.13 构建基线并收紧临时文件权限门禁\n- 补充迁移、单元测试、发布检查与运维文档
2026-07-13 18:40:48 +08:00

84 lines
2.2 KiB
YAML

services:
db:
extends:
file: docker-compose.yaml
service: db
backend:
extends:
file: docker-compose.yaml
service: backend
backend-init:
extends:
file: docker-compose.yaml
service: backend-init
frontend-dev:
image: node:22.13-alpine
container_name: ctms_frontend_dev
restart: always
working_dir: /app
command:
- sh
- -c
- |
set -e
lock_hash="$$(sha256sum package-lock.json | awk '{print $$1}')"
dependency_hash="$$lock_hash:$$(node --version)"
marker="node_modules/.ctms-package-lock.sha256"
missing_runtime_deps=0
for dep in @tauri-apps/api @tauri-apps/plugin-dialog @tauri-apps/plugin-fs @tauri-apps/plugin-opener pdfjs-dist; do
if [ ! -d "node_modules/$$dep" ]; then
missing_runtime_deps=1
fi
done
if [ ! -f "$$marker" ] || [ "$$(cat "$$marker")" != "$$dependency_hash" ] || [ "$$missing_runtime_deps" = "1" ]; then
npm ci
printf '%s' "$$dependency_hash" > "$$marker"
fi
npm run dev -- --host 0.0.0.0
environment:
NPM_CONFIG_REGISTRY: ${NPM_CONFIG_REGISTRY:-https://registry.npmmirror.com}
VITE_RUNTIME_ENV: ${ENV:-development}
VITE_ALLOW_INSECURE_DEV_LOGIN: ${VITE_ALLOW_INSECURE_DEV_LOGIN:-true}
VITE_HMR_CLIENT_PORT: ${VITE_HMR_CLIENT_PORT:-8888}
healthcheck:
test: ["CMD-SHELL", "wget -q -O /dev/null http://127.0.0.1:5173/"]
interval: 2s
timeout: 2s
retries: 90
start_period: 5s
volumes:
- ./frontend:/app
- frontend_node_modules_node22:/app/node_modules
depends_on:
- backend
networks:
- ctms_net
nginx:
image: nginx:1.27-alpine
container_name: ctms_nginx
restart: always
ports:
- "8888:80"
volumes:
- ./nginx/nginx.dev.conf:/etc/nginx/nginx.conf:ro
- ./nginx/certs:/etc/nginx/certs:ro
- ./frontend/public/favicon.ico:/usr/share/nginx/html/favicon.ico:ro
depends_on:
backend:
condition: service_healthy
frontend-dev:
condition: service_healthy
networks:
- ctms_net
volumes:
frontend_node_modules_node22:
networks:
ctms_net:
driver: bridge