# 生产/试运行部署:app(单容器:API + worker + web 静态)+ postgres 两个服务。 # 用法: # export SECRET_MASTER_KEY=$(openssl rand -hex 32) POSTGRES_PASSWORD=$(openssl rand -hex 16) # docker compose up -d --build # 开发只起数据库用 docker-compose.dev.yml。 name: umt x-logging: &logging driver: json-file options: max-size: "10m" max-file: "5" services: postgres: image: postgres:16-alpine restart: unless-stopped environment: POSTGRES_USER: umt POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?请设置 POSTGRES_PASSWORD} POSTGRES_DB: umt volumes: - umt-pg-data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U umt -d umt"] interval: 5s timeout: 3s retries: 20 logging: *logging app: build: context: . args: APP_VERSION: ${APP_VERSION:-} image: uhd-media-tool:${APP_VERSION:-latest} restart: unless-stopped depends_on: postgres: condition: service_healthy environment: NODE_ENV: production DATABASE_URL: postgres://umt:${POSTGRES_PASSWORD}@postgres:5432/umt SECRET_MASTER_KEY: ${SECRET_MASTER_KEY:?请设置 SECRET_MASTER_KEY(至少 32 字节随机串)} LOG_LEVEL: ${LOG_LEVEL:-info} ports: - "${UMT_PORT:-4380}:4380" stop_grace_period: 15s logging: *logging volumes: umt-pg-data: