name: gptibo-storefront x-runtime: &runtime image: gptibo-storefront:${RELEASE_VERSION:-local} restart: unless-stopped read_only: true cap_drop: [ALL] security_opt: [no-new-privileges:true] stop_grace_period: 20s secrets: [app_password] networks: [database, default] environment: &app-environment DB_HOST: postgres DB_NAME: storefront DB_USER: storefront_app DB_PASSWORD_FILE: /run/secrets/app_password DB_SSLMODE: disable WORKER_ID: storefront-worker depends_on: postgres: condition: service_healthy logging: driver: json-file options: max-size: 10m max-file: "3" services: postgres: image: postgres:18.6-bookworm restart: unless-stopped environment: POSTGRES_DB: storefront POSTGRES_USER: storefront_owner POSTGRES_PASSWORD_FILE: /run/secrets/owner_password secrets: [owner_password] volumes: [postgres:/var/lib/postgresql] networks: [database] healthcheck: test: [CMD-SHELL, "pg_isready -U storefront_owner -d storefront"] interval: 5s timeout: 3s retries: 20 logging: driver: json-file options: max-size: 10m max-file: "3" api: <<: *runtime build: context: . dockerfile: deploy/Dockerfile command: [api] secrets: [app_password, auth_secret] environment: <<: *app-environment LISTEN_ADDR: 0.0.0.0:8093 PUBLIC_ORIGIN: ${PUBLIC_ORIGIN:-http://127.0.0.1:8093} TRUSTED_PROXY_CIDRS: ${TRUSTED_PROXY_CIDRS:-} AUTH_SECRET_FILE: /run/secrets/auth_secret MAIL_ENABLED: "false" ports: ["127.0.0.1:8093:8093"] healthcheck: test: [CMD, /app/storefront, health-api] interval: 10s timeout: 5s start_period: 20s retries: 3 worker: <<: *runtime command: [worker] secrets: [app_password, auth_secret] environment: <<: *app-environment PUBLIC_ORIGIN: ${PUBLIC_ORIGIN:-http://127.0.0.1:8093} AUTH_SECRET_FILE: /run/secrets/auth_secret MAIL_ENABLED: "false" healthcheck: test: [CMD, /app/storefront, health-worker] interval: 10s timeout: 8s start_period: 20s retries: 3 maintenance: image: gptibo-storefront:${RELEASE_VERSION:-local} profiles: [maintenance] command: [migrate] read_only: true cap_drop: [ALL] security_opt: [no-new-privileges:true] secrets: [owner_password, app_password] networks: [database] environment: DB_HOST: postgres DB_NAME: storefront DB_USER: storefront_owner DB_PASSWORD_FILE: /run/secrets/owner_password DB_SSLMODE: disable APP_DB_PASSWORD_FILE: /run/secrets/app_password depends_on: postgres: condition: service_healthy volumes: postgres: networks: database: internal: true secrets: auth_secret: file: ./.secrets/auth-secret owner_password: file: ./.secrets/owner-password app_password: file: ./.secrets/app-password