# documentation: https://weaviate.io/developers/weaviate
# slogan: Weaviate is an open-source vector database that stores both objects and vectors, allowing for combining vector search with structured filtering.
# tags: ai, vector-database, semantic-search, machine-learning, bm25, embeddings, llm
# logo: svgs/weaviate.png
# port: 8080


services:
  weaviate:
    image: "cr.weaviate.io/semitechnologies/weaviate:1.26.4"
    volumes:
      - "weaviate-data:/var/lib/weaviate"
    command:
      - "--host"
      - 0.0.0.0
      - "--port"
      - "8080"
      - "--scheme"
      - http
    environment:
      - SERVICE_FQDN_WEAVIATE_8080
      - DISABLE_TELEMETRY=${DISABLE_TELEMETRY:-true}
      - QUERY_DEFAULTS_LIMIT=${QUERY_DEFAULTS_LIMIT:-1000}
      - LOG_LEVEL=${LOG_LEVEL:-info}
      - GOMEMLIMIT=${GOMEMLIMIT:-1024MiB}
      - GOMAXPROCS=${GOMAXPROCS:-2}
      - AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED=${AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED:-false}
      - AUTHORIZATION_ADMINLIST_USERS=${AUTHORIZATION_ADMINLIST_USERS:-admin@example.com}
      - AUTHENTICATION_APIKEY_USERS=${AUTHENTICATION_APIKEY_USERS:-admin@example.com}
      - AUTHENTICATION_APIKEY_ENABLED=${AUTHENTICATION_APIKEY_ENABLED:-true}
      - AUTHENTICATION_APIKEY_ALLOWED_KEYS=${SERVICE_PASSWORD_APIKEYS}
      - PERSISTENCE_DATA_PATH=/var/lib/weaviate
      - DEFAULT_VECTORIZER_MODULE=${DEFAULT_VECTORIZER_MODULE:-none}
      - ENABLE_MODULES=${ENABLE_MODULES:-text2vec-openai,generative-openai,qna-openai}
      - CLUSTER_HOSTNAME=${CLUSTER_HOSTNAME:-node1}
    healthcheck:
      test:
        - CMD
        - wget
        - "-q"
        - "--spider"
        - "http://localhost:8080/v1/.well-known/ready"
      interval: 5s
      timeout: 30s
      retries: 10
