-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
377 lines (329 loc) · 13.7 KB
/
docker-compose.dev.yml
File metadata and controls
377 lines (329 loc) · 13.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
# ==============================================================================
# Thoth AI Research Assistant - Development Configuration
#
# MICROSERVICES ARCHITECTURE (use --profile microservices):
# - Runs each service in separate containers
# - Hot-reload enabled via source mounting
# - Debug logging and development tools
# - 5 containers: api, mcp, monitor, dashboard, discovery
#
# Example: docker compose -f docker-compose.dev.yml --profile microservices up -d
#
# ==============================================================================
services:
# ==============================================================================
# Infrastructure Services
# ==============================================================================
# NOTE: Letta services are now external (docker-compose.letta.yml)
# Start Letta first: docker compose -f docker-compose.letta.yml up -d
# Or use: make letta-start
# ==============================================================================
# PostgreSQL Database for Letta Memory System - EXTERNAL (optional fallback)
thoth-api:
profiles: ["microservices"]
image: ghcr.io/acertainknight/project-thoth/dev-api:${THOTH_IMAGE_TAG:-latest}
build:
context: .
dockerfile: Dockerfile
args:
SERVICE_EXTRAS: "service-api"
container_name: thoth-dev-api
user: "1000:1000" # Run as host user for proper file permissions
env_file:
- .env
environment:
# =============================================================================
# SIMPLIFIED CONFIGURATION - All paths loaded from settings.json via config.py
# =============================================================================
# Previously had 40+ environment variables that duplicated settings.json.
# Removed: LETTA_DIR, LETTA_LOGS_DIR, LETTA_CACHE_DIR, LETTA_CONFIG_DIR
# and other path-related variables that are now managed by config.py
# =============================================================================
# Prioritize mounted source over installed package for hot-reload
- PYTHONPATH=/app/src
# Playwright browsers path (writable by thoth user)
- PLAYWRIGHT_BROWSERS_PATH=/app/.cache/ms-playwright
# Vault configuration (REQUIRED - tells config.py where to find settings)
- OBSIDIAN_VAULT_PATH=/vault
- THOTH_SETTINGS_FILE=/vault/thoth/_thoth/settings.json
# Service discovery (REQUIRED - inter-service communication URLs)
- THOTH_LETTA_URL=http://letta-server:8283
- THOTH_MCP_URL=http://thoth-mcp:8001
- THOTH_DISCOVERY_URL=http://thoth-discovery:8004
- DATABASE_URL=postgresql://thoth:thoth_password@letta-postgres:5432/thoth
# Development settings (REQUIRED - dev-specific configuration)
- THOTH_LOG_LEVEL=DEBUG
- THOTH_DEV_MODE=1
# Hot-reload configuration
# Automatically reload when vault/thoth/_thoth/settings.json changes
# No container restart needed!
- THOTH_HOT_RELOAD=1
- DOCKER_ENV=true
# API Keys (REQUIRED - loaded from .env file)
- OPENAI_API_KEY=${OPENAI_API_KEY:-}
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-}
- API_MISTRAL_KEY=${API_MISTRAL_KEY:-}
- API_OPENROUTER_KEY=${API_OPENROUTER_KEY:-}
- API_SEMANTIC_SCHOLAR_KEY=${API_SEMANTIC_SCHOLAR_KEY:-}
# Multi-user (container always sees /vaults regardless of host path)
- THOTH_VAULTS_ROOT=/vaults
volumes:
- ${OBSIDIAN_VAULT_PATH:-./workspace}:/vault:rw # Mount entire vault
- ./src:/app/src:ro # Mount source for development
- ${THOTH_VAULTS_ROOT:-./vaults}:/vaults:rw # Multi-user vault root
ports:
- "8000:8000"
networks:
- thoth-dev-network
- letta-network # Connect to external Letta network
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "http://localhost:8000/health"]
interval: 15s
timeout: 5s
retries: 5
start_period: 60s
# MCP Server (Model Context Protocol)
thoth-mcp:
profiles: ["microservices"]
image: ghcr.io/acertainknight/project-thoth/dev-mcp:${THOTH_IMAGE_TAG:-latest}
build:
context: .
dockerfile: docker/mcp/Dockerfile
target: development
args:
SERVICE_EXTRAS: "service-mcp"
container_name: thoth-dev-mcp
command: ["python", "-m", "thoth", "mcp", "http", "--host", "0.0.0.0", "--port", "8001", "--log-level", "DEBUG"]
user: "1000:1000" # Run as host user for proper file permissions
env_file:
- .env
environment:
# =============================================================================
# SIMPLIFIED CONFIGURATION - All paths loaded from settings.json via config.py
# =============================================================================
# Previously had 40+ environment variables that duplicated settings.json.
# Removed: LETTA_DIR, LETTA_LOGS_DIR, LETTA_CACHE_DIR, LETTA_CONFIG_DIR,
# HOME, THOTH_MCP_HOST, THOTH_MCP_PORT (defaults handled by config.py)
# =============================================================================
# Vault configuration (REQUIRED - tells config.py where to find settings)
- OBSIDIAN_VAULT_PATH=/vault
- THOTH_SETTINGS_FILE=/vault/thoth/_thoth/settings.json
# Service discovery (REQUIRED - inter-service communication URLs)
- THOTH_LETTA_URL=http://letta-server:8283
- THOTH_API_URL=http://thoth-api:8000
- DATABASE_URL=postgresql://thoth:thoth_password@letta-postgres:5432/thoth
# Development settings (REQUIRED - dev-specific configuration)
- THOTH_LOG_LEVEL=DEBUG
# Prioritize mounted source over installed package for hot-reload
- PYTHONPATH=/app/src:${PYTHONPATH:-}
# Hot-reload configuration
# Automatically reload when vault/thoth/_thoth/settings.json changes
# No container restart needed!
- THOTH_HOT_RELOAD=1
- DOCKER_ENV=true
# API Keys (REQUIRED - loaded from .env file)
- OPENAI_API_KEY=${OPENAI_API_KEY:-}
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-}
# Multi-user
- THOTH_VAULTS_ROOT=/vaults
volumes:
- ${OBSIDIAN_VAULT_PATH:-./workspace}:/vault:rw # Mount entire vault
- ./src:/app/src:ro # Mount source for development
- ${THOTH_VAULTS_ROOT:-./vaults}:/vaults:rw
ports:
- "8082:8001" # HTTP transport (includes /mcp and /sse endpoints)
networks:
- thoth-dev-network
- letta-network # Connect to external Letta network
depends_on:
thoth-api:
condition: service_healthy
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8001/health"]
interval: 15s
timeout: 5s
retries: 5
start_period: 60s
# Discovery Service - Research Question Scheduler
thoth-discovery:
profiles: ["microservices"]
image: ghcr.io/acertainknight/project-thoth/dev-discovery:${THOTH_IMAGE_TAG:-latest}
build:
context: .
dockerfile: Dockerfile
args:
SERVICE_EXTRAS: "service-discovery"
container_name: thoth-dev-discovery
user: "1000:1000" # Run as host user for proper file permissions
command: ["python", "-m", "thoth", "research", "scheduler"]
env_file:
- .env
environment:
# Prioritize mounted source over installed package for hot-reload
- PYTHONPATH=/app/src
# Vault configuration (REQUIRED - tells config.py where to find settings)
- OBSIDIAN_VAULT_PATH=/vault
- THOTH_SETTINGS_FILE=/vault/thoth/_thoth/settings.json
# Service discovery (REQUIRED - inter-service communication URLs)
- THOTH_API_URL=http://thoth-api:8000
- DATABASE_URL=postgresql://thoth:thoth_password@letta-postgres:5432/thoth
# Development settings (REQUIRED - dev-specific configuration)
- THOTH_LOG_LEVEL=DEBUG
# Hot-reload configuration
- THOTH_HOT_RELOAD=1
- DOCKER_ENV=true
# Playwright browser path (fixed location, independent of HOME/user)
- PLAYWRIGHT_BROWSERS_PATH=/app/.cache/ms-playwright
# Discovery settings (REQUIRED - service-specific overrides)
- THOTH_DISCOVERY_AUTO_START_SCHEDULER=true
- THOTH_DISCOVERY_DEFAULT_MAX_ARTICLES=50
# API Keys (REQUIRED - loaded from .env file)
- API_SEMANTIC_SCHOLAR_KEY=${API_SEMANTIC_SCHOLAR_KEY:-}
- API_WEB_SEARCH_KEY=${API_WEB_SEARCH_KEY:-}
# Multi-user
- THOTH_VAULTS_ROOT=/vaults
volumes:
- ${OBSIDIAN_VAULT_PATH:-./workspace}:/vault:rw # Mount entire vault
- ./src:/app/src:ro # Mount source for development
- ${THOTH_VAULTS_ROOT:-./vaults}:/vaults:rw
ports:
- "8004:8000" # Map external 8004 to internal 8000 (FastAPI default)
networks:
- thoth-dev-network
- letta-network # Connect to external Letta network
healthcheck:
test: ["CMD", "python", "-c", "import sys; sys.exit(0)"]
interval: 30s
timeout: 5s
retries: 3
start_period: 60s
# Monitor Service (optimized PDF processing)
thoth-monitor:
profiles: ["microservices"]
image: ghcr.io/acertainknight/project-thoth/dev-monitor:${THOTH_IMAGE_TAG:-latest}
build:
context: .
dockerfile: Dockerfile
args:
SERVICE_EXTRAS: "service-monitor"
container_name: thoth-dev-pdf-monitor
user: "1000:1000" # Run as host user for proper file permissions
command: ["python", "-m", "thoth.run_monitor_standalone"]
env_file:
- .env
environment:
# Prioritize mounted source over installed package for hot-reload
- PYTHONPATH=/app/src
# Vault configuration (REQUIRED - tells config.py where to find settings)
- OBSIDIAN_VAULT_PATH=/vault
- THOTH_SETTINGS_FILE=/vault/thoth/_thoth/settings.json
# Service discovery (REQUIRED - inter-service communication URLs)
- THOTH_API_URL=http://thoth-api:8000
- DATABASE_URL=postgresql://thoth:thoth_password@letta-postgres:5432/thoth
# Development settings (REQUIRED - dev-specific configuration)
- THOTH_LOG_LEVEL=DEBUG
# Hot-reload configuration
- THOTH_HOT_RELOAD=1
- DOCKER_ENV=true
# Monitor settings (REQUIRED - service-specific configuration)
- THOTH_PDF_MONITOR_INTERVAL=30
# API Keys (REQUIRED - loaded from .env file)
- OPENAI_API_KEY=${OPENAI_API_KEY:-}
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-}
- API_MISTRAL_KEY=${API_MISTRAL_KEY:-}
# Multi-user
- THOTH_VAULTS_ROOT=/vaults
volumes:
- ${OBSIDIAN_VAULT_PATH:-./workspace}:/vault:rw # Mount entire vault
- ./src:/app/src:ro # Mount source for development
- ${THOTH_VAULTS_ROOT:-./vaults}:/vaults:rw
networks:
- thoth-dev-network
- letta-network # Connect to external Letta network for PostgreSQL access
depends_on:
thoth-api:
condition: service_healthy
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "kill -0 1"]
interval: 60s
timeout: 10s
retries: 3
start_period: 30s
# Dashboard Service
thoth-dashboard:
profiles: ["microservices"]
image: ghcr.io/acertainknight/project-thoth/dev-dashboard:${THOTH_IMAGE_TAG:-latest}
build:
context: .
dockerfile: Dockerfile
args:
SERVICE_EXTRAS: "service-dashboard"
container_name: thoth-dev-dashboard
user: "1000:1000" # Run as host user for proper file permissions
command: [
"python", "-m", "thoth", "research", "start-dashboard",
"--check-interval", "60"
]
env_file:
- .env
environment:
# Prioritize mounted source over installed package for hot-reload
- PYTHONPATH=/app/src
# Vault configuration (REQUIRED - tells config.py where to find settings)
- OBSIDIAN_VAULT_PATH=/vault
- THOTH_SETTINGS_FILE=/vault/thoth/_thoth/settings.json
# Service discovery (REQUIRED - inter-service communication URLs)
- THOTH_API_URL=http://thoth-api:8000
- DATABASE_URL=postgresql://thoth:thoth_password@letta-postgres:5432/thoth
# Development settings (REQUIRED - dev-specific configuration)
- THOTH_LOG_LEVEL=DEBUG
# Hot-reload configuration
- THOTH_HOT_RELOAD=1
- DOCKER_ENV=true
# API Keys (REQUIRED - loaded from .env file)
- OPENAI_API_KEY=${OPENAI_API_KEY:-}
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-}
# Multi-user
- THOTH_VAULTS_ROOT=/vaults
volumes:
- ${OBSIDIAN_VAULT_PATH:-./workspace}:/vault:rw # Mount entire vault
- ./src:/app/src:ro # Mount source for development
- ${THOTH_VAULTS_ROOT:-./vaults}:/vaults:rw
networks:
- thoth-dev-network
- letta-network # Connect to external Letta network
depends_on:
thoth-api:
condition: service_healthy
restart: unless-stopped
healthcheck:
disable: true # Dashboard is a background monitoring service, doesn't expose HTTP endpoints
# ==============================================================================
# Development Volumes
# ==============================================================================
volumes:
thoth-dev-letta-data:
driver: local
name: thoth-dev-letta-data
thoth-dev-letta-postgres:
driver: local
name: thoth-dev-letta-postgres
# NOTE: workspace is now local bind mount (./workspace)
# See bind mount volumes in services above
# ==============================================================================
# Development Network
# ==============================================================================
networks:
thoth-dev-network:
driver: bridge
name: thoth-dev-network
ipam:
config:
- subnet: 172.21.0.0/16
# External Letta network (from docker-compose.letta.yml)
letta-network:
external: true
name: letta-network