-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
577 lines (548 loc) · 17 KB
/
docker-compose.yml
File metadata and controls
577 lines (548 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
# Solace-AI Docker Compose Configuration
# Local development environment with all infrastructure components
#
# Usage:
# docker-compose up -d # Start all services
# docker-compose up -d postgres redis # Start only infrastructure
# docker-compose logs -f kafka # View Kafka logs
# docker-compose down -v # Stop and remove volumes
#
# Environment variables should be set in a .env file (see .env.example)
version: '3.8'
services:
# =============================================================================
# INFRASTRUCTURE SERVICES
# =============================================================================
postgres:
image: postgres:16-alpine
container_name: solace-postgres
environment:
POSTGRES_DB: ${POSTGRES_DATABASE:-solace}
POSTGRES_USER: ${POSTGRES_USER:-solace}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-solace_dev_password}
ports:
- "${POSTGRES_PORT:-5432}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./infrastructure/init-db:/docker-entrypoint-initdb.d:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-solace} -d ${POSTGRES_DATABASE:-solace}"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
networks:
- data
redis:
image: redis:7-alpine
container_name: solace-redis
command: redis-server --appendonly yes ${REDIS_PASSWORD:+--requirepass ${REDIS_PASSWORD}}
ports:
- "${REDIS_PORT:-6379}:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
networks:
- data
zookeeper:
image: confluentinc/cp-zookeeper:7.5.0
container_name: solace-zookeeper
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
ports:
- "2181:2181"
volumes:
- zookeeper_data:/var/lib/zookeeper/data
- zookeeper_logs:/var/lib/zookeeper/log
healthcheck:
test: ["CMD", "nc", "-z", "localhost", "2181"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
networks:
- data
kafka:
image: confluentinc/cp-kafka:7.5.0
container_name: solace-kafka
depends_on:
zookeeper:
condition: service_healthy
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092,PLAINTEXT_HOST://localhost:29092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true"
ports:
- "29092:29092"
# 9092 is the internal broker port — only expose to host if external clients need it.
# Services on solace-network reach Kafka via kafka:9092 without host port mapping.
# - "9092:9092"
volumes:
- kafka_data:/var/lib/kafka/data
healthcheck:
test: ["CMD", "kafka-broker-api-versions", "--bootstrap-server", "localhost:9092"]
interval: 10s
timeout: 10s
retries: 5
restart: unless-stopped
networks:
- data
weaviate:
image: semitechnologies/weaviate:1.22.4
container_name: solace-weaviate
environment:
QUERY_DEFAULTS_LIMIT: 25
# SECURITY: Anonymous access disabled. Use API key authentication.
AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: "false"
AUTHENTICATION_APIKEY_ENABLED: "true"
AUTHENTICATION_APIKEY_ALLOWED_KEYS: "${WEAVIATE_API_KEY:-solace-dev-key-change-in-production}"
AUTHENTICATION_APIKEY_USERS: "solace-admin"
PERSISTENCE_DATA_PATH: "/var/lib/weaviate"
DEFAULT_VECTORIZER_MODULE: "none"
ENABLE_MODULES: ""
CLUSTER_HOSTNAME: "node1"
ports:
- "${WEAVIATE_PORT:-8080}:8080"
volumes:
- weaviate_data:/var/lib/weaviate
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/v1/.well-known/ready"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
networks:
- data
# =============================================================================
# OBSERVABILITY STACK
# =============================================================================
jaeger:
image: jaegertracing/all-in-one:1.51
container_name: solace-jaeger
environment:
COLLECTOR_OTLP_ENABLED: "true"
ports:
- "16686:16686" # Jaeger UI
- "4317:4317" # OTLP gRPC
- "4318:4318" # OTLP HTTP
- "6831:6831/udp" # Thrift compact
restart: unless-stopped
networks:
- monitoring
prometheus:
image: prom/prometheus:v2.47.0
container_name: solace-prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.enable-lifecycle'
ports:
- "9090:9090"
volumes:
- ./infrastructure/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus_data:/prometheus
restart: unless-stopped
networks:
- monitoring
grafana:
image: grafana/grafana:10.1.0
container_name: solace-grafana
environment:
# SECURITY: Change default admin credentials in production via GRAFANA_USER / GRAFANA_PASSWORD env vars.
GF_SECURITY_ADMIN_USER: ${GRAFANA_USER:-admin}
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_PASSWORD:-admin}
GF_USERS_ALLOW_SIGN_UP: "false"
ports:
- "3000:3000"
volumes:
- grafana_data:/var/lib/grafana
- ./infrastructure/grafana/provisioning:/etc/grafana/provisioning:ro
depends_on:
- prometheus
restart: unless-stopped
networks:
- monitoring
# =============================================================================
# APPLICATION SERVICES
# =============================================================================
user-service:
build:
context: ./services/user-service
dockerfile: Dockerfile
container_name: solace-user-service
environment:
USER_SERVICE_ENV: development
USER_SERVICE_PORT: 8001
USER_SERVICE_JWT_SECRET_KEY: ${JWT_SECRET_KEY:-dev-jwt-secret-key-minimum-32-chars}
USER_SERVICE_FIELD_ENCRYPTION_KEY: ${FIELD_ENCRYPTION_KEY:-dev-encryption-key-32-characters}
AUTH_SECRET_KEY: ${JWT_SECRET_KEY:-dev-jwt-secret-key-minimum-32-chars}
FERNET_TOKEN_KEY: "${FERNET_TOKEN_KEY:-8kTaL3nRf9xQpZmVwYdE7gHjKbNcSuW2A5iO0tP4rXs=}"
FERNET_FIELD_KEY: "${FERNET_FIELD_KEY:-3mBvN7xRtYfW0pLqKjH8dS5gC2eA9iZuO6wTrXnMaQs=}"
USER_DB_HOST: postgres
USER_DB_PORT: 5432
USER_DB_NAME: solace
USER_DB_USER: ${POSTGRES_USER:-solace}
USER_DB_PASSWORD: ${POSTGRES_PASSWORD:-solace_dev_password}
USER_REDIS_HOST: redis
USER_REDIS_PORT: 6379
USER_KAFKA_BOOTSTRAP_SERVERS: kafka:9092
SECURITY_JWT_SECRET: ${JWT_SECRET_KEY:-dev-jwt-secret-key-minimum-32-chars}
ports:
- "8001:8001"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8001/health"]
interval: 30s
timeout: 10s
retries: 3
restart: unless-stopped
networks:
- backend
- data
safety-service:
build:
context: ./services/safety_service
dockerfile: Dockerfile
container_name: solace-safety-service
environment:
SAFETY_ENVIRONMENT: development
SAFETY_PORT: 8002
ESCALATION_NOTIFICATION_SERVICE_URL: http://notification-service:8003
SAFETY_REPO_STORAGE_BACKEND: postgres
SAFETY_REPO_POSTGRES_DSN: postgresql+asyncpg://${POSTGRES_USER:-solace}:${POSTGRES_PASSWORD:-solace_dev_password}@postgres:5432/solace
SAFETY_REPO_REDIS_URL: redis://redis:6379/0
SAFETY_EVENTS_KAFKA_BOOTSTRAP_SERVERS: kafka:9092
AUTH_SECRET_KEY: ${JWT_SECRET_KEY:-dev-jwt-secret-key-minimum-32-chars}
ports:
- "8002:8002"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
kafka:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8002/health"]
interval: 30s
timeout: 10s
retries: 3
restart: unless-stopped
networks:
- backend
- data
notification-service:
build:
context: ./services/notification-service
dockerfile: Dockerfile
container_name: solace-notification-service
environment:
NOTIFICATION_SERVICE_ENV: development
NOTIFICATION_SERVICE_PORT: 8003
EMAIL_ENABLED: "true"
EMAIL_SMTP_HOST: ${SMTP_HOST:-mailhog}
EMAIL_SMTP_PORT: ${SMTP_PORT:-1025}
SMS_ENABLED: "false"
PUSH_ENABLED: "false"
AUTH_SECRET_KEY: ${JWT_SECRET_KEY:-dev-jwt-secret-key-minimum-32-chars}
ports:
- "8003:8003"
depends_on:
- mailhog
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8003/health"]
interval: 30s
timeout: 10s
retries: 3
restart: unless-stopped
networks:
- backend
- data
diagnosis-service:
build:
context: ./services/diagnosis_service
dockerfile: Dockerfile
container_name: solace-diagnosis-service
environment:
DIAGNOSIS_ENVIRONMENT: development
DIAGNOSIS_PORT: 8004
DIAGNOSIS_DB_HOST: postgres
DIAGNOSIS_DB_PORT: 5432
DIAGNOSIS_DB_NAME: solace
DIAGNOSIS_DB_USER: ${POSTGRES_USER:-solace}
DIAGNOSIS_DB_PASSWORD: ${POSTGRES_PASSWORD:-solace_dev_password}
DIAGNOSIS_REDIS_HOST: redis
DIAGNOSIS_REDIS_PORT: 6379
AUTH_SECRET_KEY: ${JWT_SECRET_KEY:-dev-jwt-secret-key-minimum-32-chars}
ports:
- "8004:8004"
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8004/health"]
interval: 30s
timeout: 10s
retries: 3
restart: unless-stopped
networks:
- backend
- data
memory-service:
build:
context: ./services/memory_service
dockerfile: Dockerfile
container_name: solace-memory-service
environment:
MEMORY_SERVICE_ENV: development
MEMORY_SERVICE_PORT: 8005
MEMORY_DB_HOST: postgres
MEMORY_DB_PORT: 5432
MEMORY_DB_DATABASE: solace
MEMORY_DB_USER: ${POSTGRES_USER:-solace}
MEMORY_DB_PASSWORD: ${POSTGRES_PASSWORD:-solace_dev_password}
MEMORY_REDIS_HOST: redis
MEMORY_REDIS_PORT: 6379
WEAVIATE_HOST: weaviate
WEAVIATE_PORT: 8080
MEMORY_KAFKA_BOOTSTRAP_SERVERS: kafka:9092
AUTH_SECRET_KEY: ${JWT_SECRET_KEY:-dev-jwt-secret-key-minimum-32-chars}
ports:
- "8005:8005"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
weaviate:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8005/health"]
interval: 30s
timeout: 10s
retries: 3
restart: unless-stopped
networks:
- backend
- data
therapy-service:
build:
context: ./services/therapy_service
dockerfile: Dockerfile
container_name: solace-therapy-service
environment:
THERAPY_ENVIRONMENT: development
THERAPY_PORT: 8006
THERAPY_DB_HOST: postgres
THERAPY_DB_PORT: 5432
THERAPY_DB_DATABASE: solace
THERAPY_DB_USER: ${POSTGRES_USER:-solace}
THERAPY_DB_PASSWORD: ${POSTGRES_PASSWORD:-solace_dev_password}
THERAPY_REDIS_HOST: redis
THERAPY_REDIS_PORT: 6379
AUTH_SECRET_KEY: ${JWT_SECRET_KEY:-dev-jwt-secret-key-minimum-32-chars}
ports:
- "8006:8006"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8006/health"]
interval: 30s
timeout: 10s
retries: 3
restart: unless-stopped
networks:
- backend
- data
personality-service:
build:
context: ./services/personality_service
dockerfile: Dockerfile
container_name: solace-personality-service
environment:
PERSONALITY_ENVIRONMENT: development
PERSONALITY_PORT: 8007
PERSONALITY_DB_HOST: postgres
PERSONALITY_DB_PORT: 5432
PERSONALITY_DB_NAME: solace
PERSONALITY_DB_USER: ${POSTGRES_USER:-solace}
PERSONALITY_DB_PASSWORD: ${POSTGRES_PASSWORD:-solace_dev_password}
PERSONALITY_REDIS_HOST: redis
PERSONALITY_REDIS_PORT: 6379
AUTH_SECRET_KEY: ${JWT_SECRET_KEY:-dev-jwt-secret-key-minimum-32-chars}
ports:
- "8007:8007"
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8007/health"]
interval: 30s
timeout: 10s
retries: 3
restart: unless-stopped
networks:
- backend
- data
orchestrator-service:
build:
context: ./services/orchestrator_service
dockerfile: Dockerfile
container_name: solace-orchestrator-service
environment:
ORCHESTRATOR_ENVIRONMENT: development
ORCHESTRATOR_PORT: 8000
SERVICE_SAFETY_SERVICE_URL: http://safety-service:8002
SERVICE_PERSONALITY_SERVICE_URL: http://personality-service:8007
SERVICE_DIAGNOSIS_SERVICE_URL: http://diagnosis-service:8004
SERVICE_THERAPY_SERVICE_URL: http://therapy-service:8006
SERVICE_MEMORY_SERVICE_URL: http://memory-service:8005
SERVICE_USER_SERVICE_URL: http://user-service:8001
SERVICE_NOTIFICATION_SERVICE_URL: http://notification-service:8003
AUTH_SECRET_KEY: ${JWT_SECRET_KEY:-dev-jwt-secret-key-minimum-32-chars}
ports:
- "8000:8000"
depends_on:
- safety-service
- memory-service
- therapy-service
- diagnosis-service
- personality-service
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
restart: unless-stopped
networks:
- backend
- frontend
analytics-service:
build:
context: ./services/analytics-service
dockerfile: Dockerfile
container_name: solace-analytics-service
environment:
ANALYTICS_SERVICE_ENV: development
ANALYTICS_SERVICE_PORT: 8009
CONSUMER_KAFKA_ENABLED: "true"
CONSUMER_KAFKA_BOOTSTRAP_SERVERS: kafka:9092
AUTH_SECRET_KEY: ${JWT_SECRET_KEY:-dev-jwt-secret-key-minimum-32-chars}
ports:
- "8009:8009"
depends_on:
kafka:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8009/health"]
interval: 30s
timeout: 10s
retries: 3
restart: unless-stopped
networks:
- backend
- data
config-service:
build:
context: ./services/config_service
dockerfile: Dockerfile
container_name: solace-config-service
environment:
CONFIG_ENVIRONMENT: development
CONFIG_PORT: 8008
CONFIG_REDIS_URL: redis://redis:6379/0
AUTH_SECRET_KEY: ${JWT_SECRET_KEY:-dev-jwt-secret-key-minimum-32-chars}
ports:
- "8008:8008"
depends_on:
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8008/health"]
interval: 30s
timeout: 10s
retries: 3
restart: unless-stopped
networks:
- backend
- data
# =============================================================================
# DEVELOPMENT TOOLS
# =============================================================================
mailhog:
image: mailhog/mailhog:v1.0.1
container_name: solace-mailhog
ports:
- "1025:1025" # SMTP
- "8025:8025" # Web UI
restart: unless-stopped
networks:
- backend
# Kafka UI for development
kafka-ui:
image: provectuslabs/kafka-ui:latest
container_name: solace-kafka-ui
environment:
KAFKA_CLUSTERS_0_NAME: solace-local
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:9092
KAFKA_CLUSTERS_0_ZOOKEEPER: zookeeper:2181
ports:
- "8081:8080"
depends_on:
kafka:
condition: service_healthy
restart: unless-stopped
networks:
- data
# =============================================================================
# VOLUMES
# =============================================================================
volumes:
postgres_data:
driver: local
redis_data:
driver: local
kafka_data:
driver: local
zookeeper_data:
driver: local
zookeeper_logs:
driver: local
weaviate_data:
driver: local
prometheus_data:
driver: local
grafana_data:
driver: local
# =============================================================================
# NETWORKS
# =============================================================================
networks:
frontend:
driver: bridge
backend:
driver: bridge
data:
driver: bridge
monitoring:
driver: bridge