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

  valkey:
    image: valkey/valkey-extensions:latest
    ports:
      - "6379:6379"
    healthcheck:
      test: ["CMD", "valkey-cli", "ping"]
      interval: 5s
      timeout: 3s
      retries: 5

  qdrant:
    image: qdrant/qdrant:latest
    ports:
      - "6333:6333"
    volumes:
      - qdrant_data:/qdrant/storage
    healthcheck:
      test: ["CMD-SHELL", "curl -sf http://localhost:6333/healthz || exit 1"]
      interval: 5s
      timeout: 5s
      retries: 5

volumes:
  postgres_data:
  qdrant_data:
