forked from Cognition-Partner-Workshops/otterworks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
559 lines (558 loc) · 16.7 KB
/
Copy pathdocker-compose.yml
File metadata and controls
559 lines (558 loc) · 16.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
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
version: '3.9'
services:
api-gateway:
build:
context: ./services/api-gateway
dockerfile: Dockerfile
container_name: otterworks-api-gateway
ports:
- 8080:8080
environment:
AWS_REGION: us-east-1
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
AWS_ENDPOINT_URL: http://localstack:4566
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
POSTGRES_USER: otterworks
POSTGRES_PASSWORD: otterworks_dev
POSTGRES_DB: otterworks
REDIS_HOST: redis
REDIS_PORT: 6379
OTEL_EXPORTER_OTLP_ENDPOINT: http://otel-collector:4318
OTEL_SERVICE_NAME: api-gateway
AUTH_SERVICE_URL: http://auth-service:8081
FILE_SERVICE_URL: http://file-service:8082
DOCUMENT_SERVICE_URL: http://document-service:8083
COLLAB_SERVICE_URL: http://collab-service:8084
NOTIFICATION_SERVICE_URL: http://notification-service:8086
SEARCH_SERVICE_URL: http://search-service:8087
ANALYTICS_SERVICE_URL: http://analytics-service:8088
ADMIN_SERVICE_URL: http://admin-service:8089
AUDIT_SERVICE_URL: http://audit-service:8090
REPORT_SERVICE_URL: http://report-service:8091
JWT_SECRET: ${JWT_SECRET:-otterworks-local-dev-jwt-secret-change-me-in-production}
depends_on:
- auth-service
healthcheck:
test:
- CMD-SHELL
- wget -q -O- http://127.0.0.1:8080/health || exit 1
interval: 10s
timeout: 5s
retries: 3
security_opt:
- no-new-privileges:true
read_only: true
tmpfs:
- /tmp
auth-service:
build:
context: ./services/auth-service
dockerfile: Dockerfile
container_name: otterworks-auth-service
ports:
- 8081:8081
environment:
AWS_REGION: us-east-1
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
AWS_ENDPOINT_URL: http://localstack:4566
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
POSTGRES_USER: otterworks
POSTGRES_PASSWORD: otterworks_dev
POSTGRES_DB: otterworks
REDIS_HOST: redis
REDIS_PORT: 6379
OTEL_EXPORTER_OTLP_ENDPOINT: http://otel-collector:4318
OTEL_SERVICE_NAME: auth-service
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/otterworks
SPRING_DATASOURCE_USERNAME: otterworks
SPRING_DATASOURCE_PASSWORD: otterworks_dev
JWT_SECRET: ${JWT_SECRET:-otterworks-local-dev-jwt-secret-change-me-in-production}
depends_on:
postgres:
condition: service_healthy
healthcheck:
test:
- CMD
- curl
- -f
- http://localhost:8081/health
interval: 15s
timeout: 5s
retries: 5
security_opt:
- no-new-privileges:true
read_only: true
tmpfs:
- /tmp
file-service:
build:
context: ./services/file-service
dockerfile: Dockerfile
container_name: otterworks-file-service
ports:
- 8082:8082
environment:
AWS_REGION: us-east-1
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
AWS_ENDPOINT_URL: http://localstack:4566
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
POSTGRES_USER: otterworks
POSTGRES_PASSWORD: otterworks_dev
POSTGRES_DB: otterworks
REDIS_HOST: redis
REDIS_PORT: 6379
OTEL_EXPORTER_OTLP_ENDPOINT: http://otel-collector:4318
OTEL_SERVICE_NAME: file-service
S3_BUCKET: otterworks-files
DYNAMODB_TABLE: otterworks-file-metadata
SNS_TOPIC_ARN: arn:aws:sns:us-east-1:000000000000:otterworks-events
SEARCH_SERVICE_URL: http://search-service:8087
# Failed uploads fire a Grafana-style alert at admin-service's ingest
# endpoint so each failure opens its own incident + Devin session.
ADMIN_SERVICE_URL: http://admin-service:8089
ALERT_WEBHOOK_SECRET: ${ALERT_WEBHOOK_SECRET:-demo-alert-secret}
# Off locally even on this demo variant branch: the permanent failure is
# baked into the file-service image (see its Dockerfile) for tenant
# coggtm, and this explicit false overrides it so a local stack still
# behaves like the golden app. Set it to true to reproduce the tenant.
FILE_UPLOAD_ALWAYS_FAIL: ${FILE_UPLOAD_ALWAYS_FAIL:-false}
FILE_SHARE_EVENT_ALWAYS_FAIL: ${FILE_SHARE_EVENT_ALWAYS_FAIL:-false}
FILE_SEED_DEMO_DOCS: ${FILE_SEED_DEMO_DOCS:-false}
JWT_SECRET: ${JWT_SECRET:-otterworks-local-dev-jwt-secret-change-me-in-production}
depends_on:
localstack:
condition: service_healthy
healthcheck:
test:
- CMD
- curl
- -f
- http://localhost:8082/health
interval: 10s
timeout: 5s
retries: 3
security_opt:
- no-new-privileges:true
read_only: true
tmpfs:
- /tmp
document-service:
build:
context: ./services/document-service
dockerfile: Dockerfile
container_name: otterworks-document-service
ports:
- 8083:8083
environment:
AWS_REGION: us-east-1
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
AWS_ENDPOINT_URL: http://localstack:4566
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
POSTGRES_USER: otterworks
POSTGRES_PASSWORD: otterworks_dev
POSTGRES_DB: otterworks
REDIS_HOST: redis
REDIS_PORT: 6379
OTEL_EXPORTER_OTLP_ENDPOINT: http://otel-collector:4318
OTEL_SERVICE_NAME: document-service
DOC_SVC_DATABASE_URL: postgresql+asyncpg://otterworks:otterworks_dev@postgres:5432/otterworks
DOC_SVC_SNS_TOPIC_ARN: arn:aws:sns:us-east-1:000000000000:otterworks-events
DOC_SVC_AWS_ENDPOINT_URL: http://localstack:4566
DOC_SVC_SNS_ENABLED: 'true'
JWT_SECRET: ${JWT_SECRET:-otterworks-local-dev-jwt-secret-change-me-in-production}
depends_on:
postgres:
condition: service_healthy
healthcheck:
test:
- CMD
- curl
- -f
- http://localhost:8083/health
interval: 10s
timeout: 5s
retries: 3
security_opt:
- no-new-privileges:true
read_only: true
tmpfs:
- /tmp
collab-service:
build:
context: ./services/collab-service
dockerfile: Dockerfile
container_name: otterworks-collab-service
ports:
- 8084:8084
environment:
AWS_REGION: us-east-1
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
AWS_ENDPOINT_URL: http://localstack:4566
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
POSTGRES_USER: otterworks
POSTGRES_PASSWORD: otterworks_dev
POSTGRES_DB: otterworks
REDIS_HOST: redis
REDIS_PORT: 6379
OTEL_EXPORTER_OTLP_ENDPOINT: http://otel-collector:4318
OTEL_SERVICE_NAME: collab-service
HTTP_PORT: 8084
JWT_SECRET: ${JWT_SECRET:-otterworks-local-dev-jwt-secret-change-me-in-production}
depends_on:
redis:
condition: service_healthy
healthcheck:
test:
- CMD
- curl
- -f
- http://localhost:8084/health
interval: 10s
timeout: 5s
retries: 3
security_opt:
- no-new-privileges:true
read_only: true
tmpfs:
- /tmp
notification-service:
build:
context: ./services/notification-service
dockerfile: Dockerfile
container_name: otterworks-notification-service
ports:
- 8086:8086
environment:
AWS_REGION: us-east-1
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
AWS_ENDPOINT_URL: http://localstack:4566
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
POSTGRES_USER: otterworks
POSTGRES_PASSWORD: otterworks_dev
POSTGRES_DB: otterworks
REDIS_HOST: redis
REDIS_PORT: 6379
OTEL_EXPORTER_OTLP_ENDPOINT: http://otel-collector:4318
OTEL_SERVICE_NAME: notification-service
SQS_QUEUE_URL: http://localstack:4566/000000000000/otterworks-notifications
SNS_TOPIC_ARN: arn:aws:sns:us-east-1:000000000000:otterworks-events
DYNAMODB_TABLE_NOTIFICATIONS: otterworks-notifications
DYNAMODB_TABLE_PREFERENCES: otterworks-notification-preferences
# Consumer failures fire a Grafana-style alert at admin-service's ingest
# endpoint so a sustained failure opens an incident + Devin session.
ADMIN_SERVICE_URL: http://admin-service:8089
ALERT_WEBHOOK_SECRET: ${ALERT_WEBHOOK_SECRET:-demo-alert-secret}
# Off by default (matches the image's Dockerfile default). Set it to true
# to point the consumer at a nonexistent queue; NOTIFICATION_STRICT_SCHEMA
# instead reproduces the strict-parser deserialization failure (needs
# message traffic, e.g. sharing a file).
NOTIFICATION_SQS_ALWAYS_FAIL: ${NOTIFICATION_SQS_ALWAYS_FAIL:-false}
NOTIFICATION_STRICT_SCHEMA: ${NOTIFICATION_STRICT_SCHEMA:-false}
JWT_SECRET: ${JWT_SECRET:-otterworks-local-dev-jwt-secret-change-me-in-production}
depends_on:
localstack:
condition: service_healthy
healthcheck:
test:
- CMD
- curl
- -f
- http://localhost:8086/health
interval: 10s
timeout: 5s
retries: 3
security_opt:
- no-new-privileges:true
read_only: true
tmpfs:
- /tmp
search-service:
build:
context: ./services/search-service
dockerfile: Dockerfile
container_name: otterworks-search-service
ports:
- 8087:8087
environment:
AWS_REGION: us-east-1
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
AWS_ENDPOINT_URL: http://localstack:4566
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
POSTGRES_USER: otterworks
POSTGRES_PASSWORD: otterworks_dev
POSTGRES_DB: otterworks
REDIS_HOST: redis
REDIS_PORT: 6379
MEILISEARCH_URL: http://meilisearch:7700
OTEL_EXPORTER_OTLP_ENDPOINT: http://otel-collector:4318
OTEL_SERVICE_NAME: search-service
SQS_ENABLED: 'true'
SQS_QUEUE_URL: http://localstack:4566/000000000000/otterworks-search-events
JWT_SECRET: ${JWT_SECRET:-otterworks-local-dev-jwt-secret-change-me-in-production}
depends_on:
meilisearch:
condition: service_healthy
healthcheck:
test:
- CMD
- curl
- -f
- http://localhost:8087/health
interval: 10s
timeout: 5s
retries: 3
security_opt:
- no-new-privileges:true
read_only: true
tmpfs:
- /tmp
analytics-service:
build:
context: ./services/analytics-service
dockerfile: Dockerfile
container_name: otterworks-analytics-service
ports:
- 8088:8088
environment:
AWS_REGION: us-east-1
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
AWS_ENDPOINT_URL: http://localstack:4566
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
POSTGRES_USER: otterworks
POSTGRES_PASSWORD: otterworks_dev
POSTGRES_DB: otterworks
REDIS_HOST: redis
REDIS_PORT: 6379
OTEL_EXPORTER_OTLP_ENDPOINT: http://otel-collector:4318
OTEL_SERVICE_NAME: analytics-service
S3_DATA_LAKE_BUCKET: otterworks-data-lake
JWT_SECRET: ${JWT_SECRET:-otterworks-local-dev-jwt-secret-change-me-in-production}
depends_on:
localstack:
condition: service_healthy
postgres:
condition: service_healthy
healthcheck:
test:
- CMD
- curl
- -f
- http://localhost:8088/health
interval: 10s
timeout: 5s
retries: 3
security_opt:
- no-new-privileges:true
read_only: true
tmpfs:
- /tmp
admin-service:
build:
context: ./services/admin-service
dockerfile: Dockerfile
container_name: otterworks-admin-service
ports:
- 8089:8089
environment:
AWS_REGION: us-east-1
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
AWS_ENDPOINT_URL: http://localstack:4566
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
POSTGRES_USER: otterworks
POSTGRES_PASSWORD: otterworks_dev
POSTGRES_DB: otterworks
REDIS_HOST: redis
REDIS_PORT: 6379
OTEL_EXPORTER_OTLP_ENDPOINT: http://otel-collector:4318
OTEL_SERVICE_NAME: admin-service
RAILS_ENV: development
JWT_SECRET: ${JWT_SECRET:-otterworks-local-dev-jwt-secret-change-me-in-production}
DATABASE_URL: postgres://otterworks:otterworks_dev@postgres:5432/otterworks
DATABASE_HOST: postgres
DATABASE_PORT: 5432
DATABASE_USER: otterworks
DATABASE_PASSWORD: otterworks_dev
SECRET_KEY_BASE: dev-secret-key-base-otterworks-change-in-production
DEVIN_API_KEY: ${DEVIN_API_KEY:-}
DEVIN_ORG_ID: ${DEVIN_ORG_ID:-}
SLACK_WEBHOOK_URL: ${SLACK_WEBHOOK_URL:-}
SLACK_BOT_TOKEN: ${SLACK_BOT_TOKEN:-}
SLACK_ONCALL_MEMBER: ${SLACK_ONCALL_MEMBER:-}
SLACK_USER_MAP: ${SLACK_USER_MAP:-}
ALERT_WEBHOOK_SECRET: ${ALERT_WEBHOOK_SECRET:-demo-alert-secret}
CHAOS_SECRET: ${CHAOS_SECRET:-}
depends_on:
postgres:
condition: service_healthy
healthcheck:
test:
- CMD
- curl
- -f
- http://localhost:8089/health
interval: 15s
timeout: 5s
retries: 5
security_opt:
- no-new-privileges:true
tmpfs:
- /tmp
- /app/tmp:uid=1001,gid=1001
- /app/log:uid=1001,gid=1001
report-service:
build:
context: ./services/report-service
dockerfile: Dockerfile
container_name: otterworks-report-service
ports:
- 8091:8091
environment:
AWS_REGION: us-east-1
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
AWS_ENDPOINT_URL: http://localstack:4566
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
POSTGRES_USER: otterworks
POSTGRES_PASSWORD: otterworks_dev
POSTGRES_DB: otterworks
REDIS_HOST: redis
REDIS_PORT: 6379
OTEL_EXPORTER_OTLP_ENDPOINT: http://otel-collector:4318
OTEL_SERVICE_NAME: report-service
DB_HOST: postgres
JWT_SECRET: ${JWT_SECRET:-otterworks-local-dev-jwt-secret-change-me-in-production}
DB_PORT: 5432
DB_NAME: otterworks_reports
DB_USER: otterworks
DB_PASSWORD: otterworks_dev
ANALYTICS_SERVICE_URL: http://analytics-service:8088
AUDIT_SERVICE_URL: http://audit-service:8090
AUTH_SERVICE_URL: http://auth-service:8081
REPORT_OUTPUT_DIR: /tmp/reports
depends_on:
postgres:
condition: service_healthy
healthcheck:
test:
- CMD
- curl
- -f
- http://localhost:8091/health
interval: 15s
timeout: 5s
retries: 5
security_opt:
- no-new-privileges:true
read_only: true
tmpfs:
- /tmp
audit-service:
build:
context: ./services/audit-service
dockerfile: Dockerfile
container_name: otterworks-audit-service
ports:
- 8090:8090
environment:
AWS_REGION: us-east-1
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
AWS_ENDPOINT_URL: http://localstack:4566
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
POSTGRES_USER: otterworks
POSTGRES_PASSWORD: otterworks_dev
POSTGRES_DB: otterworks
REDIS_HOST: redis
REDIS_PORT: 6379
OTEL_EXPORTER_OTLP_ENDPOINT: http://otel-collector:4318
OTEL_SERVICE_NAME: audit-service
DYNAMODB_TABLE: otterworks-audit-events
Aws__EndpointUrl: http://localstack:4566
Aws__DynamoDbTable: otterworks-audit-events
Aws__S3ArchiveBucket: otterworks-audit-archive
ASPNETCORE_URLS: http://+:8090
JWT_SECRET: ${JWT_SECRET:-otterworks-local-dev-jwt-secret-change-me-in-production}
depends_on:
localstack:
condition: service_healthy
healthcheck:
test:
- CMD
- curl
- -f
- http://localhost:8090/health
interval: 10s
timeout: 5s
retries: 3
security_opt:
- no-new-privileges:true
read_only: true
tmpfs:
- /tmp
web-app:
build:
context: ./frontend/client-app
dockerfile: Dockerfile
args:
VITE_COLLAB_WS_URL: ws://localhost:8084
container_name: otterworks-web-app
ports:
- 3000:3000
environment:
API_GATEWAY_URL: http://api-gateway:8080
depends_on:
- api-gateway
security_opt:
- no-new-privileges:true
read_only: true
tmpfs:
- /tmp
volumes:
# Writable tmpfs so the unprivileged nginx entrypoint (uid 101) can render
# the envsubst config template despite the read-only root filesystem.
- type: tmpfs
target: /etc/nginx/conf.d
tmpfs:
mode: 0777
admin-dashboard:
build:
context: ./frontend/admin-dashboard
dockerfile: Dockerfile
container_name: otterworks-admin-dashboard
ports:
- 4200:4200
environment:
API_URL: http://localhost:8080
depends_on:
- api-gateway
security_opt:
- no-new-privileges:true
read_only: true
tmpfs:
- /tmp
networks:
default:
name: otterworks-network
volumes:
postgres_data: null
localstack_data: null