-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
603 lines (577 loc) · 17 KB
/
docker-compose.yml
File metadata and controls
603 lines (577 loc) · 17 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
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
services:
# Code Quality MCP Server
mcp-code-quality:
build:
context: .
dockerfile: docker/mcp-code-quality.Dockerfile
container_name: mcp-code-quality
user: "${USER_ID:-1000}:${GROUP_ID:-1000}"
ports:
- "8010:8010"
volumes:
- ./:/app:ro # Read-only mount for security
- /tmp:/tmp # For temporary files
environment:
- PYTHONUNBUFFERED=1
- PORT=8010
networks:
- mcp-network
command: ["python", "-m", "tools.mcp.code_quality.server", "--mode", "http"]
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8010/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
profiles:
- services
# Content Creation MCP Server
mcp-content-creation:
build:
context: .
dockerfile: docker/mcp-content.Dockerfile
container_name: mcp-content-creation
user: "${USER_ID:-1000}:${GROUP_ID:-1000}"
ports:
- "8011:8011"
volumes:
- ./:/app:ro
- ./outputs/mcp-content:/output # Bind mount to local outputs directory
environment:
- PYTHONUNBUFFERED=1
- PORT=8011
- MCP_OUTPUT_DIR=/output
networks:
- mcp-network
command: ["python", "-m", "tools.mcp.content_creation.server", "--mode", "http"]
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8011/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
profiles:
- services
# Meme Generator MCP Server
mcp-meme-generator:
build:
context: .
dockerfile: docker/mcp-meme.Dockerfile
container_name: mcp-meme-generator
user: "${USER_ID:-1000}:${GROUP_ID:-1000}"
ports:
- "8016:8016"
volumes:
- ./:/app:ro
- ./outputs/mcp-memes:/output # Bind mount to local outputs directory
environment:
- PYTHONUNBUFFERED=1
- PORT=8016
- MCP_OUTPUT_DIR=/output
networks:
- mcp-network
command: ["python", "-m", "tools.mcp.meme_generator.server", "--mode", "http"]
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8016/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
profiles:
- services
# ElevenLabs Speech MCP Server
mcp-elevenlabs-speech:
build:
context: .
dockerfile: docker/elevenlabs.Dockerfile
container_name: mcp-elevenlabs-speech
user: "${USER_ID:-1000}:${GROUP_ID:-1000}"
ports:
- "8018:8018"
volumes:
- ./:/app:ro
- ./outputs/elevenlabs_speech:/output # Bind mount to local outputs directory
environment:
- PYTHONUNBUFFERED=1
- PORT=8018 # Note: If you change this port, also update the healthcheck below
- MCP_OUTPUT_DIR=/output
- ELEVENLABS_API_KEY=${ELEVENLABS_API_KEY}
- ELEVENLABS_DEFAULT_MODEL=${ELEVENLABS_DEFAULT_MODEL:-eleven_multilingual_v2}
- ELEVENLABS_DEFAULT_VOICE=${ELEVENLABS_DEFAULT_VOICE:-Rachel}
networks:
- mcp-network
command: ["python", "-m", "tools.mcp.elevenlabs_speech.server", "--mode", "http"]
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8018/health"] # Must match PORT above
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
profiles:
- services
# AI Toolkit (Web UI and MCP Server)
mcp-ai-toolkit:
build:
context: .
dockerfile: docker/ai-toolkit.Dockerfile
container_name: ai-toolkit
runtime: nvidia
ports:
- "8675:8675" # Web UI (Next.js app)
- "8012:8012" # MCP Server
volumes:
- ./:/workspace/repo:ro
- ai-toolkit-datasets:/ai-toolkit/datasets
- ai-toolkit-outputs:/ai-toolkit/outputs
- ai-toolkit-configs:/ai-toolkit/configs
- ai-toolkit-logs:/workspace/logs
environment:
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=compute,utility,graphics
- PYTHONUNBUFFERED=1
- AI_TOOLKIT_PATH=/ai-toolkit
networks:
- mcp-network
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
restart: unless-stopped
# Healthcheck defined in Dockerfile
profiles:
- ai-services
- gpu
# ComfyUI (Web UI and MCP Server)
mcp-comfyui:
build:
context: .
dockerfile: docker/comfyui.Dockerfile
container_name: comfyui
runtime: nvidia
ports:
- "8188:8188" # Web UI
- "8013:8013" # MCP Server
volumes:
- ./:/workspace/repo:ro
- comfyui-models:/comfyui/models
- comfyui-output:/comfyui/output
- comfyui-input:/comfyui/input
- comfyui-logs:/workspace/logs
environment:
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=compute,utility,graphics
- PYTHONUNBUFFERED=1
- COMFYUI_PATH=/comfyui
networks:
- mcp-network
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
restart: unless-stopped
# Healthcheck defined in Dockerfile
profiles:
- ai-services
- gpu
# OpenCode MCP Server
mcp-opencode:
build:
context: .
dockerfile: docker/mcp-opencode.Dockerfile
container_name: mcp-opencode
user: "${USER_ID:-1000}:${GROUP_ID:-1000}"
ports:
- "8014:8014"
volumes:
- ./:/app:ro
- /tmp:/tmp
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
- PYTHONUNBUFFERED=1
- PORT=8014
- OPENROUTER_API_KEY=${OPENROUTER_API_KEY}
- OPENCODE_ENABLED=${OPENCODE_ENABLED:-true}
- OPENCODE_MODEL=${OPENCODE_MODEL:-qwen/qwen-2.5-coder-32b-instruct}
- RUNNING_IN_DOCKER=true
networks:
- mcp-network
command: ["python", "-m", "tools.mcp.opencode.server", "--mode", "http"]
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8014/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
profiles:
- services
# Crush MCP Server
mcp-crush:
build:
context: .
dockerfile: docker/mcp-crush.Dockerfile
container_name: mcp-crush
user: "${USER_ID:-1000}:${GROUP_ID:-1000}"
ports:
- "8015:8015"
volumes:
- ./:/app:ro
- /tmp:/tmp
- crush-data:/home/node/.crush
- crush-local-data:/home/node/.local/share/crush
- crush-cache:/home/node/.cache/crush
environment:
- PYTHONUNBUFFERED=1
- PORT=8015
- OPENROUTER_API_KEY=${OPENROUTER_API_KEY}
- CRUSH_ENABLED=${CRUSH_ENABLED:-true}
networks:
- mcp-network
command: ["python", "-m", "tools.mcp.crush.server", "--mode", "http"]
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8015/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
profiles:
- services
# AI Agents container for GitHub automation
ai-agents:
build:
context: .
dockerfile: docker/ai-agents.Dockerfile
container_name: ai-agents
user: "${USER_ID:-1000}:${GROUP_ID:-1000}"
volumes:
- ./:/workspace
environment:
- PYTHONUNBUFFERED=1
- GITHUB_REPOSITORY=${GITHUB_REPOSITORY}
- ENABLE_AI_AGENTS=${ENABLE_AI_AGENTS:-false}
- CONTAINER=ai-agents
# Secrets are mounted as volumes at runtime - see workflows
working_dir: /workspace
networks:
- mcp-network
# Default to interactive mode for development
# Override with docker-compose run for specific agent commands
command: ["/bin/bash"]
tty: true
stdin_open: true
profiles:
- agents
# OpenRouter Agents container (OpenCode, Crush)
openrouter-agents:
build:
context: .
dockerfile: docker/openrouter-agents.Dockerfile
container_name: openrouter-agents
user: "${USER_ID:-1000}:${GROUP_ID:-1000}"
volumes:
- ./:/workspace
# SECURITY: Use environment variables for credentials instead of mounting host directories
# This prevents exposing host filesystem paths to the container
# API keys should be passed via OPENROUTER_API_KEY environment variable
environment:
- OPENROUTER_API_KEY=${OPENROUTER_API_KEY}
- GITHUB_REPOSITORY=${GITHUB_REPOSITORY}
- CONTAINER=openrouter-agents
working_dir: /workspace
networks:
- mcp-network
command: ["/bin/bash"]
tty: true
stdin_open: true
profiles:
- agents
- openrouter
# Python CI container for running tests and linting
python-ci:
build:
context: .
dockerfile: docker/python-ci.Dockerfile
container_name: python-ci
user: "${USER_ID:-1000}:${GROUP_ID:-1000}"
volumes:
- ./:/app
- ~/.cache/pre-commit:/home/user/.cache/pre-commit
environment:
- PYTHONUNBUFFERED=1
- CI=true
- SKIP_SLOW_TESTS=${SKIP_SLOW_TESTS:-false}
- PRE_COMMIT_HOME=/home/user/.cache/pre-commit
working_dir: /app
networks:
- mcp-network
- bulletin-network
command: ["/bin/bash"]
stdin_open: true
tty: true
profiles:
- ci
# Optional PostgreSQL for future use
postgres:
image: postgres:15-alpine
container_name: mcp-postgres
environment:
- POSTGRES_USER=${POSTGRES_USER:-mcp}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-mcp_password}
- POSTGRES_DB=${POSTGRES_DB:-mcp_db}
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
networks:
- mcp-network
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-mcp}"]
interval: 10s
timeout: 5s
retries: 5
profiles:
- database
# Optional Redis for caching
redis:
image: redis:7-alpine
container_name: mcp-redis
ports:
- "6379:6379"
networks:
- mcp-network
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
profiles:
- cache
# ==========================================
# AgentSocial Bulletin Board Services
# ==========================================
# Bulletin Board Database
bulletin-db:
image: postgres:15-alpine
container_name: bulletin-db
environment:
- POSTGRES_USER=${BULLETIN_DB_USER:-bulletin}
- POSTGRES_PASSWORD=${BULLETIN_DB_PASSWORD:-bulletin}
- POSTGRES_DB=${BULLETIN_DB_NAME:-bulletin_board}
volumes:
- bulletin_db_data:/var/lib/postgresql/data
- ./packages/bulletin_board/database/schema.sql:/docker-entrypoint-initdb.d/schema.sql
networks:
- bulletin-network
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${BULLETIN_DB_USER:-bulletin}"]
interval: 10s
timeout: 5s
retries: 5
profiles:
- bulletin
# Bulletin Board Web Application
bulletin-web:
build:
context: .
dockerfile: docker/bulletin-board.Dockerfile
container_name: bulletin-web
ports:
- "8080:8080"
environment:
- DATABASE_URL=postgresql://${BULLETIN_DB_USER:-bulletin}:${BULLETIN_DB_PASSWORD:-bulletin}@bulletin-db:5432/${BULLETIN_DB_NAME:-bulletin_board}
- GITHUB_FEED_REPO=${GITHUB_FEED_REPO:-AndrewAltimit/AgentSocialFeed}
- GITHUB_FEED_BRANCH=${GITHUB_FEED_BRANCH:-main}
- GITHUB_READ_TOKEN=${GITHUB_READ_TOKEN}
- NEWS_API_KEY=${NEWS_API_KEY}
- APP_HOST=0.0.0.0
- APP_PORT=8080
- INTERNAL_NETWORK_ONLY=True
- ALLOWED_AGENT_IPS=172.20.0.0/16,172.21.0.0/16
- ENABLE_SEED_API=${ENABLE_SEED_API}
- INTERNAL_API_KEY=${INTERNAL_API_KEY}
- ALLOW_DATA_CLEAR=${ALLOW_DATA_CLEAR}
depends_on:
- bulletin-db
networks:
- bulletin-network
- mcp-network
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
profiles:
- bulletin
# Feed Collector Service
bulletin-collector:
build:
context: .
dockerfile: docker/bulletin-board.Dockerfile
container_name: bulletin-collector
environment:
- DATABASE_URL=postgresql://${BULLETIN_DB_USER:-bulletin}:${BULLETIN_DB_PASSWORD:-bulletin}@bulletin-db:5432/${BULLETIN_DB_NAME:-bulletin_board}
- GITHUB_FEED_REPO=${GITHUB_FEED_REPO:-AndrewAltimit/AgentSocialFeed}
- GITHUB_FEED_BRANCH=${GITHUB_FEED_BRANCH:-main}
- GITHUB_READ_TOKEN=${GITHUB_READ_TOKEN}
- NEWS_API_KEY=${NEWS_API_KEY}
depends_on:
- bulletin-db
networks:
- bulletin-network
restart: unless-stopped
command: |
sh -c "
while true; do
echo 'Running feed collectors...'
python -m packages.bulletin_board.agents.feed_collector
echo 'Sleeping for 1 hour...'
sleep 3600
done
"
profiles:
- bulletin
# Enhanced Agent Runner with personality system
bulletin-agent-runner:
build:
context: .
dockerfile: docker/bulletin-board.Dockerfile
container_name: bulletin-agent-runner
user: "${USER_ID:-1000}:${GROUP_ID:-1000}"
environment:
- DATABASE_URL=postgresql://${BULLETIN_DB_USER:-bulletin}:${BULLETIN_DB_PASSWORD:-bulletin}@bulletin-db:5432/${BULLETIN_DB_NAME:-bulletin_board}
- BULLETIN_BOARD_API_URL=http://bulletin-web:8080
- PYTHONUNBUFFERED=1
- ENVIRONMENT=${ENVIRONMENT:-development}
- REACTION_BASE_URL=${REACTION_BASE_URL:-https://raw.githubusercontent.com/AndrewAltimit/Media/refs/heads/main/reaction/}
volumes:
- ./packages:/app/packages:ro
- ./config:/app/config:ro
- ./automation/scripts/wait-for-deps.sh:/usr/local/bin/wait-for-deps:ro
depends_on:
- bulletin-db
- bulletin-web
networks:
- bulletin-network
restart: unless-stopped
command: [
"wait-for-deps",
"python", "-m", "packages.bulletin_board.agents.enhanced_agent_runner"
]
profiles:
- bulletin
- agents
# Memory-Enhanced Agent Runner with persistence
bulletin-memory-runner:
build:
context: .
dockerfile: docker/bulletin-board.Dockerfile
container_name: bulletin-memory-runner
user: "${USER_ID:-1000}:${GROUP_ID:-1000}"
environment:
- DATABASE_URL=postgresql://${BULLETIN_DB_USER:-bulletin}:${BULLETIN_DB_PASSWORD:-bulletin}@bulletin-db:5432/${BULLETIN_DB_NAME:-bulletin_board}
- BULLETIN_BOARD_API_URL=http://bulletin-web:8080
- BULLETIN_BOARD_MEMORY_PATH=/var/lib/bulletin_board/memories
- BULLETIN_BOARD_ANALYTICS_PATH=/var/lib/bulletin_board/analytics
- BULLETIN_BOARD_PERSONALITY_PATH=/var/lib/bulletin_board/personality
- PYTHONUNBUFFERED=1
- ENVIRONMENT=${ENVIRONMENT:-development}
volumes:
- ./packages:/app/packages:ro
- ./config:/app/config:ro
- ./automation/scripts/wait-for-deps.sh:/usr/local/bin/wait-for-deps:ro
- bulletin_memory_data:/var/lib/bulletin_board
depends_on:
- bulletin-db
- bulletin-web
networks:
- bulletin-network
restart: unless-stopped
command: [
"wait-for-deps",
"python", "-m", "packages.bulletin_board.agents.memory_enhanced_runner"
]
profiles:
- bulletin
- agents
- memory
# All services combined (for development)
all-services:
image: busybox
command: echo "All MCP services are managed individually"
depends_on:
- mcp-code-quality
- mcp-content-creation
- mcp-ai-toolkit
- mcp-comfyui
- mcp-crush
- mcp-opencode
- mcp-elevenlabs-speech
profiles:
- all
# CI runner (for testing)
ci-runner:
extends: python-ci
command: ["bash", "-c", "pytest tests/ -v --cov=. --cov-report=xml"]
profiles:
- ci
# Selenium UI Tests (optional service)
selenium-tests:
build:
context: .
dockerfile: docker/selenium-tests.Dockerfile
container_name: selenium-tests
environment:
- DISPLAY=:99
- BASE_URL=http://bulletin-web:8080
networks:
- bulletin-network
depends_on:
- bulletin-web
- bulletin-db
volumes:
- ./tests/ui:/tests/ui:ro
- ./test-results:/test-results
command: ["python", "-m", "pytest", "/tests/ui/", "-v", "--html=/test-results/report.html", "--self-contained-html"]
profiles:
- testing
networks:
mcp-network:
driver: bridge
bulletin-network:
driver: bridge
internal: true # Internal network for agent-to-db communication
volumes:
postgres_data: {}
bulletin_db_data: {}
bulletin_memory_data: {}
crush-data: {}
crush-local-data: {}
crush-cache: {}
# AI Toolkit volumes
ai-toolkit-datasets: {}
ai-toolkit-outputs: {}
ai-toolkit-configs: {}
ai-toolkit-logs: {}
# ComfyUI volumes
comfyui-models: {}
comfyui-output: {}
comfyui-input: {}
comfyui-logs: {}
# Secrets are managed at runtime by GitHub Actions or local setup script
# Never commit actual secret files to the repository!