version: "3.9" networks: edr-network: driver: bridge volumes: postgres-data: redis-data: services: # ONE database for the whole platform. Freight, passenger, IAM and payment are # schemas inside it, not separate databases — this mirrors production, where the # Smart Office database holds the `freight` schema alongside the rest. # # Migrated from the previous `postgres-freight` service (port 5433, db # `edr_freight`) plus a second server on 5544 for passenger. The volume is # renamed, so the first `up` runs initdb against an empty data directory and # applies initdb/01-schemas.sql. Existing 5433 data is NOT carried over # automatically — see the consolidation runbook in DEPLOYMENT.md. postgres: image: postgres:17-alpine container_name: edr-postgres restart: unless-stopped environment: POSTGRES_USER: edr POSTGRES_PASSWORD: edr_secret POSTGRES_DB: edr_database ports: - "5432:5432" volumes: - postgres-data:/var/lib/postgresql/data # Schema bootstrap. initdb only sources this on an empty volume. - ./initdb:/docker-entrypoint-initdb.d:ro healthcheck: test: ["CMD-SHELL", "pg_isready -U edr -d edr_database"] interval: 5s timeout: 5s retries: 20 networks: - edr-network redis: image: redis:7-alpine container_name: edr-redis restart: unless-stopped ports: - "6379:6379" volumes: - redis-data:/data networks: - edr-network