services:
db:
image: postgres:14
restart: always
environment:
POSTGRES_DB: warg_registry
POSTGRES_USER: postgres
POSTGRES_PASSWORD_FILE: /var/secrets/warg/data-store/postgres/password
ports:
- "${WARG_POSTGRES_LISTEN_ADDRESS?e.g., 127.0.0.1:17514}:5432"
healthcheck:
test: [ "CMD", "pg_isready", "-q", "-d", "warg_registry", "-U", "postgres" ]
interval: 1s
timeout: 1s
retries: 30
volumes:
- warg-secrets:/var/secrets/warg:ro
- postgres-data:/var/lib/postgresql/data:rw
networks:
- infra
depends_on:
import-secrets:
condition: service_completed_successfully
warg-registry-db-migration:
build:
target: warg-postgres-migration
depends_on:
db:
condition: service_healthy
import-secrets:
condition: service_completed_successfully
env_file:
- ./infra/local/.secrets/data-store/postgres/database_url_env
networks:
- infra
warg-registry:
depends_on:
import-secrets:
condition: service_completed_successfully
warg-registry-db-migration:
condition: service_completed_successfully
command:
- --data-store
- postgres
- --database-url-file
- /var/secrets/warg/data-store/postgres/database_url
volumes:
postgres-data: