增强开发部署构建配置

This commit is contained in:
Cheng Zhou
2026-06-17 17:23:13 +08:00
parent 9b2b8e90f6
commit e507ab98cb
5 changed files with 52 additions and 4 deletions
+5
View File
@@ -1,6 +1,7 @@
services:
db:
image: postgres:15-alpine
pull_policy: if_not_present
container_name: ctms_db
restart: always
environment:
@@ -24,6 +25,7 @@ services:
build:
context: ./backend
dockerfile: Dockerfile
pull: false
container_name: ctms_backend
restart: always
ports:
@@ -44,6 +46,7 @@ services:
build:
context: ./backend
dockerfile: Dockerfile
pull: false
command: python scripts/init_production.py
environment:
DATABASE_URL: postgresql+asyncpg://ctms_user:secret_password@db/ctms_db
@@ -62,7 +65,9 @@ services:
build:
context: .
dockerfile: nginx/Dockerfile
pull: false
args:
NPM_CONFIG_REGISTRY: ${NPM_CONFIG_REGISTRY:-https://registry.npmmirror.com}
VITE_RUNTIME_ENV: ${ENV:-production}
VITE_ALLOW_INSECURE_DEV_LOGIN: ${VITE_ALLOW_INSECURE_DEV_LOGIN:-false}
container_name: ctms_nginx