2026-07-21 15:28:55 +08:00
|
|
|
services:
|
|
|
|
|
app:
|
|
|
|
|
build: .
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
depends_on:
|
|
|
|
|
postgres:
|
|
|
|
|
condition: service_healthy
|
|
|
|
|
environment:
|
|
|
|
|
NODE_ENV: production
|
2026-07-21 17:13:08 +08:00
|
|
|
PORT: 3010
|
2026-07-21 15:28:55 +08:00
|
|
|
DATABASE_URL: postgresql://delivery_desk:${POSTGRES_PASSWORD}@postgres:5432/delivery_desk
|
|
|
|
|
PGSSL: disable
|
|
|
|
|
COS_CONFIG_ENCRYPTION_KEY: ${COS_CONFIG_ENCRYPTION_KEY:?COS_CONFIG_ENCRYPTION_KEY is required}
|
|
|
|
|
INITIAL_ADMIN_PASSWORD: ${INITIAL_ADMIN_PASSWORD:?INITIAL_ADMIN_PASSWORD is required}
|
|
|
|
|
INITIAL_ADMIN_USERNAME: ${INITIAL_ADMIN_USERNAME:-admin}
|
|
|
|
|
INITIAL_ADMIN_DISPLAY_NAME: ${INITIAL_ADMIN_DISPLAY_NAME:-平台管理员}
|
|
|
|
|
ports:
|
2026-07-21 17:13:08 +08:00
|
|
|
- "3010:3010"
|
2026-07-21 15:28:55 +08:00
|
|
|
healthcheck:
|
2026-07-21 17:13:08 +08:00
|
|
|
test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:3010/api/health').then(r=>{if(!r.ok)process.exit(1)})"]
|
2026-07-21 15:28:55 +08:00
|
|
|
interval: 10s
|
|
|
|
|
timeout: 5s
|
|
|
|
|
retries: 10
|
|
|
|
|
postgres:
|
|
|
|
|
image: postgres:17-alpine
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
environment:
|
|
|
|
|
POSTGRES_DB: delivery_desk
|
|
|
|
|
POSTGRES_USER: delivery_desk
|
|
|
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD is required}
|
|
|
|
|
volumes:
|
|
|
|
|
- delivery_desk_postgres:/var/lib/postgresql/data
|
|
|
|
|
healthcheck:
|
|
|
|
|
test: ["CMD-SHELL", "pg_isready -U delivery_desk -d delivery_desk"]
|
|
|
|
|
interval: 5s
|
|
|
|
|
timeout: 3s
|
|
|
|
|
retries: 10
|
|
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
|
delivery_desk_postgres:
|