services:
  kb-postgres:
    image: pgvector/pgvector:pg16
    container_name: kb-postgres
    restart: unless-stopped
    env_file:
      - .env
    environment:
      - POSTGRES_USER=kb
      - POSTGRES_DB=kb
      - TZ=Europe/Warsaw
    volumes:
      - kb_postgres_data:/var/lib/postgresql/data
      - ./init:/docker-entrypoint-initdb.d:ro
    ports:
      - "5433:5432"
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U kb -d kb"]
      interval: 10s
      timeout: 5s
      retries: 5

volumes:
  kb_postgres_data:
    name: kb_postgres_data
