# memory-server-rs stack: neo4j + qdrant + the rust memory server. # From this directory: # docker compose up -d --build name: memory-server-rs services: neo4j: image: neo4j:5-community volumes: - ./store/neo4j-data:/data environment: NEO4J_AUTH: ${NEO4J_AUTH:-neo4j/changeme-in-dotenv} ports: - "127.0.0.1:7474:7474" # http debug UI, localhost only - "127.0.0.1:7687:7687" # bolt, localhost only healthcheck: test: ["CMD-SHELL", "wget -qO- http://localhost:7474 >/dev/null 2>&1 || exit 1"] interval: 10s timeout: 5s retries: 12 start_period: 30s qdrant: image: qdrant/qdrant volumes: - ./store/qdrant-data:/qdrant/storage environment: QDRANT__SERVICE__API_KEY: ${QDRANT_API_KEY:-} ports: - "127.0.0.1:6333:6333" # dashboard/API, localhost only healthcheck: test: ["CMD", "bash", "-c", "exec 3<>/dev/tcp/localhost/6333 && printf 'GET /healthz HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n' >&3 && grep -q 200 <&3"] interval: 10s timeout: 5s retries: 12 memory-server: build: context: . dockerfile: Dockerfile volumes: # persist the bge-small model across container recreations (one-time # ~130MB huggingface download on first embed otherwise) - ./store/model-cache:/app/local_cache environment: NEO4J_URI: bolt://neo4j:7687 NEO4J_USER: neo4j NEO4J_PASSWORD: ${NEO4J_PASSWORD:-changeme-in-dotenv} # rust qdrant-client speaks gRPC on 6334 (the TS rest client used 6333) QDRANT_URL: http://qdrant:6334 QDRANT_API_KEY: ${QDRANT_API_KEY:-} PORT: "${PORT:-8080}" # set MEMORY_TOKEN in .env to require bearer auth from MCP clients MEMORY_TOKEN: ${MEMORY_TOKEN:-} ALLOWED_HOSTS: ${ALLOWED_HOSTS:-} # embeddings: unset = local bge-small-en-v1.5 (baked into the image); # set baseurl + model to use an external OpenAI-compatible /embeddings EMBEDDINGS_BASEURL: ${EMBEDDINGS_BASEURL:-} EMBEDDINGS_APIKEY: ${EMBEDDINGS_APIKEY:-} EMBEDDINGS_MODEL: ${EMBEDDINGS_MODEL:-} EMBEDDING_DIMENSIONS: ${EMBEDDING_DIMENSIONS:-} depends_on: neo4j: condition: service_healthy qdrant: condition: service_healthy healthcheck: test: ["CMD-SHELL", "curl -sf -H \"Authorization: Bearer $$MEMORY_TOKEN\" http://127.0.0.1:$$PORT/health >/dev/null || exit 1"] interval: 10s timeout: 5s retries: 12 start_period: 10s # default to localhost for host-run clients; set HOST to expose elsewhere; # keep the token (MEMORY_TOKEN in .env) when exposing beyond localhost ports: - "${HOST:-127.0.0.1}:${PORT:-8080}:${PORT:-8080}" # rebuild the qdrant index from neo4j and exit: # docker compose run --rm reindex reindex: build: context: . dockerfile: Dockerfile command: ["--reindex"] profiles: ["tools"] environment: NEO4J_URI: bolt://neo4j:7687 NEO4J_USER: neo4j NEO4J_PASSWORD: ${NEO4J_PASSWORD:-changeme-in-dotenv} # rust qdrant-client speaks gRPC on 6334 (the TS rest client used 6333) QDRANT_URL: http://qdrant:6334 QDRANT_API_KEY: ${QDRANT_API_KEY:-} depends_on: neo4j: condition: service_healthy qdrant: condition: service_healthy