services: postgres: image: postgres:15 environment: POSTGRES_DB: pgrelay POSTGRES_USER: pgrelay POSTGRES_PASSWORD: pgrelay ports: - "5432:5432" healthcheck: test: ["CMD-SHELL", "pg_isready -U pgrelay -d pgrelay"] interval: 5s timeout: 5s retries: 20 migrate: build: . command: ["migrate", "upgrade"] environment: PGRELAY_DATABASE_URL: postgresql+asyncpg://pgrelay:pgrelay@postgres:5432/pgrelay PGRELAY_API_AUTH_TOKENS: dev-token-change-me PGRELAY_HTTP_ALLOWED_HOSTS: httpbin.org,example.com depends_on: postgres: condition: service_healthy api: build: . command: ["api"] ports: - "8090:8090" environment: PGRELAY_DATABASE_URL: postgresql+asyncpg://pgrelay:pgrelay@postgres:5432/pgrelay PGRELAY_API_AUTH_TOKENS: dev-token-change-me PGRELAY_HTTP_ALLOWED_HOSTS: httpbin.org,example.com depends_on: migrate: condition: service_completed_successfully worker: build: . command: ["worker"] environment: PGRELAY_DATABASE_URL: postgresql+asyncpg://pgrelay:pgrelay@postgres:5432/pgrelay PGRELAY_API_AUTH_TOKENS: dev-token-change-me PGRELAY_HTTP_ALLOWED_HOSTS: httpbin.org,example.com depends_on: migrate: condition: service_completed_successfully