x-defaults: &defaults
  restart: unless-stopped
  logging:
    driver: json-file
    options:
      max-size: 100m
      max-file: '3'

services:
  qdrant:
    <<: *defaults
    image: ${GLOBAL_REGISTRY:-}qdrant/qdrant:${QDRANT_VERSION:-v1.15.4}
    ports:
      - '${QDRANT_HTTP_PORT:-6333}:6333'
      - '${QDRANT_GRPC_PORT:-6334}:6334'
    volumes:
      - qdrant_data:/qdrant/storage:z
    environment:
      - TZ=${TZ:-UTC}
      - QDRANT__SERVICE__API_KEY=${QDRANT_API_KEY}
      - QDRANT__SERVICE__JWT_RBAC=${QDRANT_JWT_RBAC:-false}
    deploy:
      resources:
        limits:
          cpus: ${QDRANT_CPU_LIMIT:-1.0}
          memory: ${QDRANT_MEMORY_LIMIT:-1G}
        reservations:
          cpus: ${QDRANT_CPU_RESERVATION:-0.1}
          memory: ${QDRANT_MEMORY_RESERVATION:-256M}
    healthcheck:
      test: [CMD, wget, --no-verbose, --tries=1, --spider, 'http://localhost:6333/']
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 30s

volumes:
  qdrant_data:
