Files
mem0-server/docker-compose.yaml
huaqingxu 84d210829d add
2026-03-06 23:09:44 +08:00

75 lines
2.0 KiB
YAML

version: "3.8"
services:
mem0:
build:
context: .
dockerfile: Dockerfile
ports:
- "8888:8000"
env_file:
- .env
networks:
- mem0_network
volumes:
- ./data/chroma_db:/app/data/chroma_db # ChromaDB storage
- ./data/history:/app/data/history # History db location
- .:/app # Server code. This allows to reload the app when the server code is updated
- ../mem0:/app/packages/mem0 # Mem0 library. This allows to reload the app when the library code is updated
command: uvicorn main:app --host 0.0.0.0 --port 8000 --reload # Enable auto-reload
environment:
- PYTHONDONTWRITEBYTECODE=1 # Prevents Python from writing .pyc files
- PYTHONUNBUFFERED=1 # Ensures Python output is sent straight to terminal
depends_on:
- ollama
- neo4j
# ollama:
# condition: service_healthy
ollama:
image: ollama/ollama:latest
container_name: ollama
restart: on-failure
networks:
- mem0_network
# healthcheck:
# test: ["CMD", "curl", "-f", "http://localhost:11434/api/tags"]
# interval: 5s
# timeout: 5s
# retries: 10
# start_period: 60s
volumes:
- ollama_data:/root/.ollama
ports:
- "11434:11434"
# profiles: ["gpu"]
neo4j:
image: neo4j:5.26.4
networks:
- mem0_network
# healthcheck:
# test: wget http://localhost:7687 || exit 1
# interval: 1s
# timeout: 10s
# retries: 20
# start_period: 90s
ports:
- "8474:7474" # HTTP
- "8687:7687" # Bolt
volumes:
- ./data/neo4j_data:/data
environment:
- NEO4J_AUTH=neo4j/mem0graph
- NEO4J_PLUGINS=["apoc"] # Add this line to install APOC
- NEO4J_apoc_export_file_enabled=true
- NEO4J_apoc_import_file_enabled=true
- NEO4J_apoc_import_file_use__neo4j__config=true
volumes:
ollama_data: {}
networks:
mem0_network:
driver: bridge