Files
ctms/docker-compose.dev.yaml
T
Cheng Zhou f11a5c84d9
Client Quality Gates / Shared client and Web (push) Has been cancelled
Client Quality Gates / macOS Desktop (push) Has been cancelled
feat(监控): 完善系统监控、登录状态与访问审计能力
2026-07-10 17:12:13 +08:00

83 lines
2.1 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:20-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}')"
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; do
if [ ! -d "node_modules/$$dep" ]; then
missing_runtime_deps=1
fi
done
if [ ! -f "$$marker" ] || [ "$$(cat "$$marker")" != "$$lock_hash" ] || [ "$$missing_runtime_deps" = "1" ]; then
npm ci
printf '%s' "$$lock_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:/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:
networks:
ctms_net:
driver: bridge