修复开发容器启动并加固部署配置

This commit is contained in:
Cheng Zhou
2026-06-22 15:35:00 +08:00
parent 360a2ba2b1
commit 6056c8364a
8 changed files with 88 additions and 8 deletions
+12 -1
View File
@@ -19,7 +19,18 @@ services:
container_name: ctms_frontend_dev
restart: always
working_dir: /app
command: sh -c "npm ci && npm run dev -- --host 0.0.0.0"
command:
- sh
- -c
- |
set -e
lock_hash="$$(sha256sum package-lock.json | awk '{print $$1}')"
marker="node_modules/.ctms-package-lock.sha256"
if [ ! -f "$$marker" ] || [ "$$(cat "$$marker")" != "$$lock_hash" ]; then
npm ci
printf '%s' "$$lock_hash" > "$$marker"
fi
npm run dev -- --host 0.0.0.0
environment:
VITE_RUNTIME_ENV: ${ENV:-development}
VITE_ALLOW_INSECURE_DEV_LOGIN: ${VITE_ALLOW_INSECURE_DEV_LOGIN:-true}