services: postgres: # 国内可访问的 DaoCloud 镜像源(与 Dockerfile 一致) image: docker.m.daocloud.io/library/postgres:16-alpine container_name: arcticnewone-postgres environment: POSTGRES_DB: arcticnewone POSTGRES_USER: arcticnewone POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-arcticnewone_dev_password} ports: # 宿主机 5433,避免与本机已有 PostgreSQL(5432/15432) 冲突 - "5433:5432" volumes: - postgres-data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U arcticnewone -d arcticnewone"] interval: 5s timeout: 3s retries: 10 restart: unless-stopped app: # 生产与本地使用同一 SWR 镜像(团队规范) image: swr.cn-north-4.myhuaweicloud.com/virtheart/arcticnewone:latest container_name: arcticnewone ports: - "3100:3000" environment: - NODE_ENV=production - HOST=0.0.0.0 - PORT=3000 # 数据库连接(compose 内通过服务名 postgres 访问) - NUXT_DATABASE_URL=postgres://arcticnewone:${POSTGRES_PASSWORD:-arcticnewone_dev_password}@postgres:5432/arcticnewone # JWT 签名密钥(生产必须覆盖) - NUXT_JWT_SECRET=${JWT_SECRET:-dev-only-secret-change-in-production} # SMTP 邮件通知(可选;不配置时表单/订阅仅入库) - NUXT_SMTP_HOST=${SMTP_HOST:-} - NUXT_SMTP_PORT=${SMTP_PORT:-465} - NUXT_SMTP_USER=${SMTP_USER:-} - NUXT_SMTP_PASS=${SMTP_PASS:-} - NUXT_SMTP_FROM=${SMTP_FROM:-} - NUXT_SMTP_CONTACT_TO=${SMTP_CONTACT_TO:-} depends_on: postgres: condition: service_healthy restart: unless-stopped volumes: postgres-data: