1+ # Example Docker Compose configurations for Basic Memory
2+ # Copy the relevant section to your docker-compose.yml and modify as needed
3+
4+ # ================================================================================
5+ # Example 1: Simple Obsidian Vault Integration
6+ # ================================================================================
7+ version : ' 3.8'
8+ services :
9+ basic-memory-obsidian :
10+ build : .
11+ container_name : basic-memory-obsidian
12+ volumes :
13+ # Replace with your actual Obsidian vault path
14+ - /Users/yourname/Documents/MyVault:/data/knowledge:rw
15+ - basic-memory-config:/root/.basic-memory:rw
16+ environment :
17+ - BASIC_MEMORY_PROJECTS={"obsidian" : " /data/knowledge" }
18+ - BASIC_MEMORY_DEFAULT_PROJECT=obsidian
19+ - BASIC_MEMORY_SYNC_CHANGES=true
20+ command : ["basic-memory", "mcp"]
21+ restart : unless-stopped
22+
23+ volumes :
24+ basic-memory-config :
25+
26+ ---
27+
28+ # ================================================================================
29+ # Example 2: Multiple Knowledge Bases
30+ # ================================================================================
31+ version : ' 3.8'
32+ services :
33+ basic-memory-multi :
34+ build : .
35+ container_name : basic-memory-multi
36+ volumes :
37+ - /path/to/personal-notes:/data/projects/personal:rw
38+ - /path/to/work-notes:/data/projects/work:rw
39+ - /path/to/research:/data/projects/research:rw
40+ - basic-memory-config:/root/.basic-memory:rw
41+ environment :
42+ - BASIC_MEMORY_PROJECTS={"personal" : " /data/projects/personal" , "work": "/data/projects/work", "research": "/data/projects/research"}
43+ - BASIC_MEMORY_DEFAULT_PROJECT=personal
44+ - BASIC_MEMORY_SYNC_CHANGES=true
45+ command : ["basic-memory", "mcp"]
46+ restart : unless-stopped
47+
48+ volumes :
49+ basic-memory-config :
50+
51+ ---
52+
53+ # ================================================================================
54+ # Example 3: HTTP Transport for External Integration
55+ # ================================================================================
56+ version : ' 3.8'
57+ services :
58+ basic-memory-http :
59+ build : .
60+ container_name : basic-memory-http
61+ volumes :
62+ - ./knowledge:/data/knowledge:rw
63+ - basic-memory-config:/root/.basic-memory:rw
64+ environment :
65+ - BASIC_MEMORY_PROJECTS={"main" : " /data/knowledge" }
66+ - BASIC_MEMORY_DEFAULT_PROJECT=main
67+ - BASIC_MEMORY_SYNC_CHANGES=true
68+ ports :
69+ - " 8000:8000"
70+ command : ["basic-memory", "mcp", "--transport", "sse", "--host", "0.0.0.0", "--port", "8000"]
71+ restart : unless-stopped
72+ healthcheck :
73+ test : ["CMD", "curl", "-f", "http://localhost:8000/health"]
74+ interval : 30s
75+ timeout : 10s
76+ retries : 3
77+
78+ volumes :
79+ basic-memory-config :
80+
81+ ---
82+
83+ # ================================================================================
84+ # Example 4: Integration with Existing MCP Server Stack
85+ # ================================================================================
86+ version : ' 3.8'
87+ services :
88+ # Your existing MCP server
89+ mcp-proxy :
90+ image : your-mcp-server:latest
91+ container_name : mcp-proxy
92+ depends_on :
93+ - basic-memory
94+ networks :
95+ - mcp-network
96+ # ... your MCP server configuration
97+
98+ # Basic Memory as a service
99+ basic-memory :
100+ build : .
101+ container_name : basic-memory-service
102+ volumes :
103+ - ./shared-knowledge:/data/knowledge:rw
104+ - basic-memory-config:/root/.basic-memory:rw
105+ environment :
106+ - BASIC_MEMORY_PROJECTS={"shared" : " /data/knowledge" }
107+ - BASIC_MEMORY_DEFAULT_PROJECT=shared
108+ - BASIC_MEMORY_SYNC_CHANGES=true
109+ networks :
110+ - mcp-network
111+ command : ["basic-memory", "mcp", "--transport", "sse", "--host", "0.0.0.0", "--port", "8000"]
112+ restart : unless-stopped
113+
114+ volumes :
115+ basic-memory-config :
116+
117+ networks :
118+ mcp-network :
119+ driver : bridge
120+
121+ ---
122+
123+ # ================================================================================
124+ # Example 5: Development Environment with Debug Logging
125+ # ================================================================================
126+ version : ' 3.8'
127+ services :
128+ basic-memory-dev :
129+ build : .
130+ container_name : basic-memory-dev
131+ volumes :
132+ - ./dev-knowledge:/data/knowledge:rw
133+ - basic-memory-config:/root/.basic-memory:rw
134+ # Mount source code for development (optional)
135+ # - ./src:/app/src:ro
136+ environment :
137+ - BASIC_MEMORY_PROJECTS={"dev" : " /data/knowledge" }
138+ - BASIC_MEMORY_DEFAULT_PROJECT=dev
139+ - BASIC_MEMORY_SYNC_CHANGES=true
140+ - BASIC_MEMORY_LOG_LEVEL=DEBUG
141+ - BASIC_MEMORY_SYNC_DELAY=500 # Faster sync for development
142+ ports :
143+ - " 8000:8000"
144+ command : ["basic-memory", "mcp", "--transport", "sse", "--host", "0.0.0.0", "--port", "8000"]
145+ restart : unless-stopped
146+
147+ volumes :
148+ basic-memory-config :
149+
150+ ---
151+
152+ # ================================================================================
153+ # Example 6: Production Deployment with Resource Limits
154+ # ================================================================================
155+ version : ' 3.8'
156+ services :
157+ basic-memory-prod :
158+ build : .
159+ container_name : basic-memory-prod
160+ volumes :
161+ - /var/data/knowledge:/data/knowledge:rw
162+ - basic-memory-config:/root/.basic-memory:rw
163+ environment :
164+ - BASIC_MEMORY_PROJECTS={"production" : " /data/knowledge" }
165+ - BASIC_MEMORY_DEFAULT_PROJECT=production
166+ - BASIC_MEMORY_SYNC_CHANGES=true
167+ - BASIC_MEMORY_LOG_LEVEL=INFO
168+ deploy :
169+ resources :
170+ limits :
171+ memory : 1G
172+ cpus : ' 1.0'
173+ reservations :
174+ memory : 512M
175+ cpus : ' 0.5'
176+ healthcheck :
177+ test : ["CMD", "basic-memory", "--version"]
178+ interval : 30s
179+ timeout : 10s
180+ retries : 3
181+ start_period : 60s
182+ restart : unless-stopped
183+ command : ["basic-memory", "mcp"]
184+
185+ volumes :
186+ basic-memory-config :
187+ driver : local
188+ driver_opts :
189+ type : none
190+ o : bind
191+ device : /var/data/basic-memory-config
192+
193+ ---
194+
195+ # ================================================================================
196+ # Example 7: Using with External Database (Advanced)
197+ # ================================================================================
198+ version : ' 3.8'
199+ services :
200+ basic-memory-external-db :
201+ build : .
202+ container_name : basic-memory-external
203+ volumes :
204+ - ./knowledge:/data/knowledge:rw
205+ # Mount external database location
206+ - /external/storage/basic-memory:/root/.basic-memory:rw
207+ environment :
208+ - BASIC_MEMORY_PROJECTS={"main" : " /data/knowledge" }
209+ - BASIC_MEMORY_DEFAULT_PROJECT=main
210+ - BASIC_MEMORY_SYNC_CHANGES=true
211+ command : ["basic-memory", "mcp"]
212+ restart : unless-stopped
213+
214+ # Note: No volumes section - using external storage
0 commit comments