services:
  postgres:
    image: pgvector/pgvector:pg17
    ports:
      - "5432:5432"
    environment:
      POSTGRES_USER: rpg
      POSTGRES_PASSWORD: rpg
      POSTGRES_DB: rpg_summariser
    volumes:
      - pgdata:/var/lib/postgresql/data
      - ./scripts/init-db.sql:/docker-entrypoint-initdb.d/init-test-db.sql:ro
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U rpg -d rpg_summariser"]
      interval: 2s
      timeout: 5s
      retries: 5

volumes:
  pgdata:
