x-json-log-rotation: &json-log-rotation driver: json-file options: max-size: "20m" max-file: "5" services: postgres: image: docker.m.daocloud.io/library/postgres:16-bookworm restart: unless-stopped logging: *json-log-rotation environment: TZ: ${TZ:-Asia/Shanghai} POSTGRES_DB: ${POSTGRES_DB:-order_site} POSTGRES_USER: ${POSTGRES_USER:-postgres} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres} healthcheck: test: [ "CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-order_site}", ] interval: 5s timeout: 5s retries: 20 volumes: - postgres_data:/var/lib/postgresql/data backend: build: context: . dockerfile: deploy/docker/backend.Dockerfile restart: unless-stopped env_file: - .env depends_on: postgres: condition: service_healthy healthcheck: test: ["CMD-SHELL", "curl -fsS http://127.0.0.1:3000/health/ready || exit 1"] interval: 5s timeout: 5s retries: 20 start_period: 20s environment: TZ: ${TZ:-Asia/Shanghai} PORT: ${BACKEND_PORT:-3000} DATABASE_URL: ${DATABASE_URL:-postgres://postgres:postgres@postgres:5432/order_site} DATABASE_SSL: ${DATABASE_SSL:-false} DATABASE_MAX_CONNECTIONS: ${DATABASE_MAX_CONNECTIONS:-20} DATA_ROOT: /app/data LOG_RETENTION_DAYS: ${LOG_RETENTION_DAYS:-30} CLAIM_BASE_URL: ${CLAIM_BASE_URL:-http://localhost/#/claim} ADMIN_SESSION_SECRET: ${ADMIN_SESSION_SECRET} ADMIN_DEFAULT_USERS_JSON: ${ADMIN_DEFAULT_USERS_JSON} logging: *json-log-rotation volumes: - ./apps/backend/data:/app/data web: build: context: . dockerfile: deploy/docker/frontend.Dockerfile args: APP_DOMAIN: ${APP_DOMAIN:-localhost} restart: unless-stopped logging: *json-log-rotation depends_on: backend: condition: service_healthy ports: - "80:80" - "443:443" environment: TZ: ${TZ:-Asia/Shanghai} APP_DOMAIN: ${APP_DOMAIN:-localhost} CADDY_SITE_ADDR: ${CADDY_SITE_ADDR:-http://localhost} volumes: - caddy_data:/data - caddy_config:/config volumes: postgres_data: caddy_data: caddy_config: