services:
  postgres:
    image: postgres:16
    container_name: eventhub-postgres
    environment:
      POSTGRES_DB: eventhub
      POSTGRES_USER: eventhub
      POSTGRES_PASSWORD: eventhub
    ports:
      - "5432:5432"
    volumes:
      - eventhub-postgres-data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U eventhub -d eventhub"]
      interval: 5s
      timeout: 5s
      retries: 20

volumes:
  eventhub-postgres-data:
