-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
459 lines (424 loc) · 14.8 KB
/
docker-compose.yml
File metadata and controls
459 lines (424 loc) · 14.8 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
# ═══════════════════════════════════════════════════════════════════════
# 🏢 Autonomous Multi-Agent AI Organization
# One-command startup: docker compose up -d
#
# Platform support: Linux · macOS · Windows (Docker Desktop / WSL2)
# Architecture: linux/amd64 · linux/arm64 (Apple M1/M2/M3)
#
# Services:
# Core: postgres · redis · orchestrator · api-gateway
# Agents: ceo · cto · engineer-backend · engineer-frontend
# qa · devops · finance
# Messaging: zookeeper · kafka · kafka-ui
# Observability: prometheus · grafana · jaeger
# Dashboard: nextjs-dashboard (port 3000)
# ═══════════════════════════════════════════════════════════════════════
x-agent-env: &agent-env
KAFKA_BOOTSTRAP_SERVERS: kafka:29092
KAFKA_MOCK: "false"
REDIS_URL: redis://redis:6379/0
QDRANT_URL: http://qdrant:6333
DATABASE_URL: postgresql+asyncpg://aiorg:${POSTGRES_PASSWORD}@postgres:5432/aiorg
OTEL_EXPORTER_OTLP_ENDPOINT: http://jaeger:4317
ENVIRONMENT: ${ENVIRONMENT:-development}
HTTP_PROXY: http://egress-proxy:8080
HTTPS_PROXY: http://egress-proxy:8080
NO_PROXY: localhost,127.0.0.1,postgres,redis,kafka,zookeeper,jaeger,prometheus,orchestrator,api-gateway,ws-hub,ceo-agent,cto-agent,engineer-backend,engineer-frontend,qa-agent,devops-agent,finance-agent
x-go-env: &go-env
AI_ORG_ENV: development
AI_ORG_POSTGRES__DSN: postgres://aiorg:${POSTGRES_PASSWORD}@postgres:5432/aiorg?sslmode=disable
AI_ORG_REDIS__ADDR: redis:6379
AI_ORG_KAFKA__BROKERS: kafka:29092
AI_ORG_OBSERVABILITY__LOG_LEVEL: debug
AI_ORG_OBSERVABILITY__OTLP_ENDPOINT: http://jaeger:4317
AUTH_DISABLED: "true"
x-agent-defaults: &agent-defaults
build:
context: .
dockerfile: Dockerfile.agent
restart: unless-stopped
env_file: .env
environment: *agent-env
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
kafka:
condition: service_healthy
networks:
- ai-org-net
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
# runtime: runsc # Uncomment to enable gVisor (requires runsc installed on host)
tmpfs:
- /run/secrets/ai-org:mode=1777,size=10m
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://127.0.0.1:8000/health"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
services:
# ══════════════════════════════════════════════════════════════════════
# INFRASTRUCTURE
# ══════════════════════════════════════════════════════════════════════
egress-proxy:
build:
context: ./go-backend
dockerfile: deploy/dockerfiles/Dockerfile.proxy
restart: unless-stopped
environment:
PROXY_ADDR: ":8080"
networks:
- ai-org-net
healthcheck:
test: ["CMD", "nc", "-z", "localhost", "8080"]
interval: 10s
timeout: 5s
retries: 5
postgres:
image: postgres:15-alpine
restart: unless-stopped
environment:
POSTGRES_USER: aiorg
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: aiorg
ports:
- "127.0.0.1:${POSTGRES_PORT:-5433}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./infrastructure/postgres/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U aiorg -d aiorg" ]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
networks:
- ai-org-net
qdrant:
image: qdrant/qdrant:v1.8.2
restart: unless-stopped
ports:
- "127.0.0.1:${QDRANT_PORT:-6333}:6333"
volumes:
- qdrant_data:/qdrant/storage
healthcheck:
test: [ "CMD", "wget", "--spider", "-q", "http://localhost:6333/readyz" ]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
networks:
- ai-org-net
redis:
image: redis:7-alpine
restart: unless-stopped
command: >
redis-server --maxmemory 256mb --maxmemory-policy allkeys-lru --save 60 1 --appendonly yes
ports:
- "127.0.0.1:${REDIS_PORT:-6379}:6379"
volumes:
- redis_data:/data
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 10s
timeout: 5s
retries: 5
networks:
- ai-org-net
# ══════════════════════════════════════════════════════════════════════
# MESSAGE BUS — Kafka
# ══════════════════════════════════════════════════════════════════════
zookeeper:
image: confluentinc/cp-zookeeper:7.6.0
restart: unless-stopped
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
ZOOKEEPER_LOG4J_ROOT_LOGLEVEL: WARN
volumes:
- zookeeper_data:/var/lib/zookeeper/data
healthcheck:
test: [ "CMD", "bash", "-c", "echo ruok | nc localhost 2181" ]
interval: 10s
timeout: 5s
retries: 5
start_period: 20s
networks:
- ai-org-net
kafka:
image: confluentinc/cp-kafka:7.6.0
restart: unless-stopped
depends_on:
zookeeper:
condition: service_healthy
ports:
- "127.0.0.1:${KAFKA_PORT:-9092}:9092"
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:${KAFKA_PORT:-9092}
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true"
KAFKA_LOG_RETENTION_HOURS: 24
KAFKA_LOG4J_ROOT_LOGLEVEL: WARN
KAFKA_LOG4J_LOGGERS: "kafka=WARN,kafka.controller=WARN,kafka.log.LogCleaner=WARN,state.change.logger=WARN,kafka.producer.async.DefaultEventHandler=WARN"
volumes:
- kafka_data:/var/lib/kafka/data
healthcheck:
test: [ "CMD", "kafka-topics", "--bootstrap-server", "localhost:9092", "--list" ]
interval: 15s
timeout: 10s
retries: 10
start_period: 60s
networks:
- ai-org-net
kafka-ui:
image: provectuslabs/kafka-ui:latest
restart: unless-stopped
depends_on:
kafka:
condition: service_healthy
ports:
- "${KAFKA_UI_PORT:-8888}:8080"
environment:
KAFKA_CLUSTERS_0_NAME: ai-org-local
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:29092
KAFKA_CLUSTERS_0_ZOOKEEPER: zookeeper:2181
networks:
- ai-org-net
# ══════════════════════════════════════════════════════════════════════
# CORE SERVICES
# ══════════════════════════════════════════════════════════════════════
orchestrator:
build:
context: ./go-backend
dockerfile: deploy/dockerfiles/Dockerfile.orchestrator
restart: unless-stopped
env_file: .env
environment:
<<: *go-env
AI_ORG_SERVER__PORT: 9091
# ports:
# - "9090:9090" # gRPC — kept internal-only to avoid host conflict with Prometheus
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
kafka:
condition: service_healthy
volumes:
- ./output:/app/output
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:9091/healthz"]
interval: 10s
timeout: 5s
retries: 5
networks:
- ai-org-net
ws-hub:
build:
context: ./go-backend
dockerfile: deploy/dockerfiles/Dockerfile.ws-hub
restart: unless-stopped
env_file: .env
environment:
<<: *go-env
AI_ORG_SERVER__PORT: 8081
ports:
- "8082:8081"
depends_on:
kafka:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:8081/healthz"]
interval: 10s
timeout: 5s
retries: 5
networks:
- ai-org-net
api-gateway:
build:
context: ./go-backend
dockerfile: deploy/dockerfiles/Dockerfile.gateway
restart: unless-stopped
env_file: .env
environment:
<<: *go-env
AI_ORG_SERVER__PORT: 8080
AI_ORG_ORCHESTRATOR_TARGET: orchestrator:9090
CORS_ORIGINS: "http://localhost:3000,http://127.0.0.1:3000"
ports:
- "${API_PORT:-8080}:8080"
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:8080/health"]
interval: 10s
timeout: 5s
retries: 5
depends_on:
orchestrator:
condition: service_healthy
networks:
- ai-org-net
# ══════════════════════════════════════════════════════════════════════
# AGENT MICROSERVICES
# ══════════════════════════════════════════════════════════════════════
ceo-agent:
<<: *agent-defaults
environment:
<<: *agent-env
AGENT_ROLE: CEO
PROMETHEUS_PORT: "9091"
ports:
- "9091:9091"
cto-agent:
<<: *agent-defaults
environment:
<<: *agent-env
AGENT_ROLE: CTO
PROMETHEUS_PORT: "9092"
ports:
- "9192:9092"
engineer-backend:
<<: *agent-defaults
environment:
<<: *agent-env
AGENT_ROLE: Engineer_Backend
PROMETHEUS_PORT: "9093"
ports:
- "9093:9093"
engineer-frontend:
<<: *agent-defaults
environment:
<<: *agent-env
AGENT_ROLE: Engineer_Frontend
PROMETHEUS_PORT: "9094"
ports:
- "9094:9094"
qa-agent:
<<: *agent-defaults
environment:
<<: *agent-env
AGENT_ROLE: QA
PROMETHEUS_PORT: "9095"
ports:
- "9095:9095"
devops-agent:
<<: *agent-defaults
environment:
<<: *agent-env
AGENT_ROLE: DevOps
PROMETHEUS_PORT: "9096"
ports:
- "9096:9096"
finance-agent:
<<: *agent-defaults
environment:
<<: *agent-env
AGENT_ROLE: Finance
PROMETHEUS_PORT: "9097"
ports:
- "9097:9097"
# ══════════════════════════════════════════════════════════════════════
# DASHBOARD — Next.js (will be built in feature/nextjs-dashboard)
# ══════════════════════════════════════════════════════════════════════
dashboard:
build:
context: ./dashboard
dockerfile: Dockerfile
args:
NEXT_PUBLIC_API_URL: http://localhost:8080
NEXT_PUBLIC_WS_URL: ws://localhost:8082
restart: unless-stopped
ports:
- "${DASHBOARD_PORT:-3000}:3000"
environment:
NEXT_PUBLIC_API_URL: http://localhost:${API_PORT:-8080}
NEXT_PUBLIC_WS_URL: ws://localhost:8082
depends_on:
api-gateway:
condition: service_healthy
ws-hub:
condition: service_healthy
networks:
- ai-org-net
# ══════════════════════════════════════════════════════════════════════
# OBSERVABILITY
# ══════════════════════════════════════════════════════════════════════
prometheus:
image: prom/prometheus:v2.49.1
restart: unless-stopped
ports:
- "${PROMETHEUS_PORT:-9090}:9090"
volumes:
- ./monitoring/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus_data:/prometheus
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
- "--storage.tsdb.retention.time=15d"
- "--web.enable-lifecycle"
networks:
- ai-org-net
grafana:
image: grafana/grafana:10.3.1
restart: unless-stopped
ports:
- "${GRAFANA_PORT:-3002}:3000"
environment:
GF_SECURITY_ADMIN_USER: admin
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_PASSWORD}
GF_USERS_ALLOW_SIGN_UP: "false"
volumes:
- grafana_data:/var/lib/grafana
- ./monitoring/grafana/provisioning:/etc/grafana/provisioning:ro
depends_on:
- prometheus
networks:
- ai-org-net
jaeger:
image: jaegertracing/all-in-one:1.54
restart: unless-stopped
ports:
- "${JAEGER_UI_PORT:-16686}:16686"
- "4317:4317" # OTLP gRPC
- "4318:4318" # OTLP HTTP
environment:
COLLECTOR_OTLP_ENABLED: "true"
networks:
- ai-org-net
# ════════════════════════════════════════════════════════════════════════
# VOLUMES
# ════════════════════════════════════════════════════════════════════════
volumes:
postgres_data:
driver: local
redis_data:
driver: local
qdrant_data:
driver: local
kafka_data:
driver: local
zookeeper_data:
driver: local
prometheus_data:
driver: local
grafana_data:
driver: local
# ════════════════════════════════════════════════════════════════════════
# NETWORKS
# ════════════════════════════════════════════════════════════════════════
networks:
ai-org-net:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16