Self-hosted dashboard and admin auth (#4837)

Co-authored-by: kartik-mem0 <kartik.labhshetwar@mem0.ai>
This commit is contained in:
Gabriel Stein
2026-04-23 06:36:36 -07:00
committed by GitHub
parent 15feaa8ac4
commit db8ac61713
252 changed files with 20275 additions and 331 deletions
+32 -30
View File
@@ -3,7 +3,7 @@ name: mem0-dev
services:
mem0:
build:
context: .. # Set context to parent directory
context: ..
dockerfile: server/dev.Dockerfile
ports:
- "8888:8000"
@@ -12,23 +12,27 @@ services:
networks:
- mem0_network
volumes:
- ./history:/app/history # History db location. By default, it creates a history.db file on the server folder
- .:/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
- ./history:/app/history
- .:/app
depends_on:
postgres:
condition: service_healthy
neo4j:
condition: service_healthy
command: uvicorn main:app --host 0.0.0.0 --port 8000 --reload # Enable auto-reload
command: >
sh -c "rm -rf /app/packages && pip install -q --force-reinstall --no-deps mem0ai && alembic upgrade head && uvicorn main:app --host 0.0.0.0 --port 8000 --reload"
environment:
- PYTHONDONTWRITEBYTECODE=1 # Prevents Python from writing .pyc files
- PYTHONUNBUFFERED=1 # Ensures Python output is sent straight to terminal
- PYTHONDONTWRITEBYTECODE=1
- PYTHONUNBUFFERED=1
- PYTHONPATH=
- DASHBOARD_URL=http://localhost:3000
- APP_DB_NAME=mem0_app
- JWT_SECRET=${JWT_SECRET}
- AUTH_DISABLED=${AUTH_DISABLED:-false}
- MEM0_TELEMETRY=${MEM0_TELEMETRY:-true}
postgres:
image: ankane/pgvector:v0.5.1
restart: on-failure
shm_size: "128mb" # Increase this if vacuuming fails with a "no space left on device" error
shm_size: "128mb"
networks:
- mem0_network
environment:
@@ -41,34 +45,32 @@ services:
retries: 5
volumes:
- postgres_db:/var/lib/postgresql/data
- ./init-db.sh:/docker-entrypoint-initdb.d/init-db.sh
ports:
- "8432:5432"
neo4j:
image: neo4j:5.26.4
mem0-dashboard:
build: ./dashboard
ports:
- "3000:3000"
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:
- 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
- NEXT_PUBLIC_API_URL=http://localhost:8888
- API_INTERNAL_URL=http://mem0:8000
- NEXT_PUBLIC_INSTANCE_NAME=Mem0
depends_on:
mem0:
condition: service_started
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:3000/api/health"]
interval: 10s
timeout: 5s
retries: 3
volumes:
neo4j_data:
postgres_db:
networks:
mem0_network:
driver: bridge
driver: bridge