services:
  db:
    image: pgvector/pgvector:pg16
    container_name: partnerlogic-pg
    environment:
      POSTGRES_USER: partnerlogic
      POSTGRES_PASSWORD: partnerlogic
      POSTGRES_DB: partnerlogic
    ports:
      - "5432:5432"
    volumes:
      - partnerlogic_pgdata:/var/lib/postgresql/data
      - ./sql/migration.sql:/docker-entrypoint-initdb.d/01-migration.sql:ro
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U partnerlogic -d partnerlogic"]
      interval: 5s
      timeout: 5s
      retries: 10

volumes:
  partnerlogic_pgdata:
