-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
909 lines (865 loc) · 32 KB
/
docker-compose.yml
File metadata and controls
909 lines (865 loc) · 32 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
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2025-Present Datadog, Inc.
# Stickerlandia Service Endpoints
# -------------------------------
# - Sticker Catalogue API:
# - Sticker catalog: http://localhost:8080/api/stickers/v1
# - Sticker image: http://localhost:8080/api/stickers/v1/sticker-001/image
#
# - Sticker Award API:
# - User assignments: http://localhost:8080/api/awards/v1/assignments/user-001
# - Award sticker: http://localhost:8080/api/awards/v1/assignments
#
# - User Management API: http://localhost:8080/api/users
# - Registration: http://localhost:8080/api/users/v1/register
# - Login: http://localhost:8080/api/users/v1/login
#
# - Traefik Dashboard: http://localhost:8081/dashboard/
# - Kafbat Console: http://localhost:8082
#
#
# Signing Up
# ---------
# curl -X POST http://localhost:8080/api/users/v1/register \
# -H "Content-Type: application/json" \
# -d '{
# "firstName": "John",
# "lastName": "Doe",
# "emailAddress": "john.doe@example.com",
# "password": "ValidPass123!"
# }'
#
#
# Logging In
# ----------
# curl -X POST http://localhost:8080/api/users/v1/login \
# -H "Content-Type: application/x-www-form-urlencoded" \
# -d "grant_type=password&username=john.doe@example.com&password=ValidPass123!&client_id=user-authentication&client_secret=388D45FA-B36B-4988-BA59-B187D329C207"
#
# Assigning a Sticker
# -------------------
# curl -X POST http://localhost:8080/api/awards/v1/assignments/user-123 \
# -H "Content-Type: application/json" \
# -d '{
# "stickerId": "sticker-001",
# "reason": "Excellent debugging work on the payment gateway issue"
# }'
#
services:
traefik:
image: traefik:v3.6
container_name: traefik
ports:
- "8080:80" # App traffic
- "8081:8080" # Dashboard
command:
- --api.dashboard=true
- --api.insecure=true
- --entrypoints.web.address=:80
- --entrypoints.dashboard.address=:8081
- --providers.docker=true
- --providers.docker.exposedbydefault=false
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
healthcheck:
test:
[
"CMD",
"wget",
"--no-verbose",
"--tries=1",
"--spider",
"http://localhost:8080/api/entrypoints",
]
interval: 1s
timeout: 10s
retries: 5
labels:
- "traefik.enable=true"
- "traefik.http.routers.traefik.rule=PathPrefix(`/dashboard`)"
- "traefik.http.routers.traefik.service=api@internal"
- "traefik.http.routers.traefik.entrypoints=dashboard"
kafka:
image: apache/kafka:latest
container_name: stickerlandia-kafka
ports:
- "9092:9092"
- "9644:9644"
environment:
KAFKA_BROKER_ID: 1
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT,CONTROLLER:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_PROCESS_ROLES: broker,controller
KAFKA_NODE_ID: 1
KAFKA_CONTROLLER_QUORUM_VOTERS: 1@kafka:29093
KAFKA_LISTENERS: PLAINTEXT://kafka:29092,CONTROLLER://kafka:29093,PLAINTEXT_HOST://0.0.0.0:9092
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_LOG_DIRS: /var/lib/kafka/data
healthcheck:
test:
[
"CMD-SHELL",
"/opt/kafka/bin/kafka-broker-api-versions.sh --bootstrap-server localhost:9092 || exit 1",
]
interval: 5s
timeout: 10s
retries: 10
start_period: 30s
volumes:
- kafka-data:/var/lib/kafka/data
schema-registry:
image: confluentinc/cp-schema-registry:7.6.0
container_name: schema-registry
depends_on:
kafka:
condition: service_healthy
ports:
- "8085:8081"
environment:
SCHEMA_REGISTRY_HOST_NAME: schema-registry
SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: kafka:29092
SCHEMA_REGISTRY_LISTENERS: http://0.0.0.0:8081
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8081/subjects"]
interval: 5s
timeout: 10s
retries: 10
start_period: 30s
kafbat-ui:
container_name: kafbat-ui
image: ghcr.io/kafbat/kafka-ui
ports:
- 8082:8080
depends_on:
- kafka
- schema-registry
environment:
KAFKA_CLUSTERS_0_NAME: kafka
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:29092
KAFKA_CLUSTERS_0_SCHEMAREGISTRY: http://schema-registry:8081
kafka-init:
image: confluentinc/cp-kafka:6.1.1
depends_on:
kafka:
condition: service_healthy
entrypoint: ["/bin/sh", "-c"]
restart: "no"
command: |
"
# blocks until kafka is reachable
kafka-topics --bootstrap-server kafka:29092 --list
echo -e 'Creating kafka topics'
kafka-topics --bootstrap-server kafka:29092 --create --if-not-exists --topic users.userRegistered.v1 --replication-factor 1 --partitions 1
kafka-topics --bootstrap-server kafka:29092 --create --if-not-exists --topic users.stickerClaimed.v1 --replication-factor 1 --partitions 1
kafka-topics --bootstrap-server kafka:29092 --create --if-not-exists --topic users.userDetailsUpdated.v1 --replication-factor 1 --partitions 1
kafka-topics --bootstrap-server kafka:29092 --create --if-not-exists --topic stickers.stickerAssignedToUser.v1 --replication-factor 1 --partitions 1
kafka-topics --bootstrap-server kafka:29092 --create --if-not-exists --topic stickers.stickerRemovedFromUser.v1 --replication-factor 1 --partitions 1
kafka-topics --bootstrap-server kafka:29092 --create --if-not-exists --topic stickers.stickerAdded.v1 --replication-factor 1 --partitions 1
kafka-topics --bootstrap-server kafka:29092 --create --if-not-exists --topic stickers.stickerUpdated.v1 --replication-factor 1 --partitions 1
kafka-topics --bootstrap-server kafka:29092 --create --if-not-exists --topic stickers.stickerDeleted.v1 --replication-factor 1 --partitions 1
kafka-topics --bootstrap-server kafka:29092 --create --if-not-exists --topic printJobs.queued.v1 --replication-factor 1 --partitions 1
kafka-topics --bootstrap-server kafka:29092 --create --if-not-exists --topic printJobs.failed.v1 --replication-factor 1 --partitions 1
kafka-topics --bootstrap-server kafka:29092 --create --if-not-exists --topic printJobs.completed.v1 --replication-factor 1 --partitions 1
kafka-topics --bootstrap-server kafka:29092 --create --if-not-exists --topic printers.registered.v1 --replication-factor 1 --partitions 1
kafka-topics --bootstrap-server kafka:29092 --create --if-not-exists --topic printers.deleted.v1 --replication-factor 1 --partitions 1
echo -e 'Successfully created the following topics:'
kafka-topics --bootstrap-server kafka:29092 --list
"
sticker-catalogue-db:
image: postgres:16
container_name: sticker-catalogue-db
environment:
POSTGRES_DB: sticker_catalogue
POSTGRES_USER: sticker_user
POSTGRES_PASSWORD: sticker_password
ports:
- "5432:5432"
volumes:
- sticker-catalogue-data:/var/lib/postgresql/data
- ./shared/infra/compose/postgres-init:/docker-entrypoint-initdb.d:ro
command:
- postgres
- -c
- shared_preload_libraries=pg_stat_statements
- -c
- pg_stat_statements.track=all
healthcheck:
test: ["CMD-SHELL", "pg_isready -U sticker_user -d sticker_catalogue"]
interval: 1s
timeout: 10s
retries: 5
sticker-award-db:
image: postgres:16
container_name: sticker-award-db
environment:
POSTGRES_DB: sticker_awards
POSTGRES_USER: sticker_user
POSTGRES_PASSWORD: sticker_password
ports:
- "5434:5432"
volumes:
- sticker-award-data:/var/lib/postgresql/data
- ./shared/infra/compose/postgres-init:/docker-entrypoint-initdb.d:ro
command:
- postgres
- -c
- shared_preload_libraries=pg_stat_statements
- -c
- pg_stat_statements.track=all
healthcheck:
test: ["CMD-SHELL", "pg_isready -U sticker_user -d sticker_awards"]
interval: 1s
timeout: 10s
retries: 5
user-management-db:
image: postgres:16
container_name: user-management-db
environment:
POSTGRES_DB: user_management
POSTGRES_USER: user_mgmt_user
POSTGRES_PASSWORD: user_mgmt_password
ports:
- "5433:5432"
volumes:
- user-management-data:/var/lib/postgresql/data
- ./shared/infra/compose/postgres-init:/docker-entrypoint-initdb.d:ro
command:
- postgres
- -c
- shared_preload_libraries=pg_stat_statements
- -c
- pg_stat_statements.track=all
healthcheck:
test: ["CMD-SHELL", "pg_isready -U user_mgmt_user -d user_management"]
interval: 1s
timeout: 10s
retries: 5
print-service-db:
image: postgres:16
container_name: print-service-db
environment:
POSTGRES_DB: print_service
POSTGRES_USER: print_service_user
POSTGRES_PASSWORD: print_service_password
ports:
- "5435:5432"
volumes:
- print-service-data:/var/lib/postgresql/data
- ./shared/infra/compose/postgres-init:/docker-entrypoint-initdb.d:ro
command:
- postgres
- -c
- shared_preload_libraries=pg_stat_statements
- -c
- pg_stat_statements.track=all
healthcheck:
test: ["CMD-SHELL", "pg_isready -U print_service_user -d print_service"]
interval: 1s
timeout: 10s
retries: 5
minio:
image: minio/minio:latest
container_name: stickerlandia-minio
ports:
- "9000:9000"
- "9001:9001"
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
command: server /data --console-address ":9001"
volumes:
- minio-data:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 1s
timeout: 10s
retries: 3
minio-init:
image: minio/mc:latest
container_name: minio-init
depends_on:
minio:
condition: service_healthy
entrypoint: ["/bin/sh", "-c"]
command: >
"mc alias set myminio http://minio:9000 minioadmin minioadmin &&
mc mb myminio/sticker-images --ignore-existing"
restart: "no"
sticker-catalogue:
build:
context: ./sticker-catalogue
dockerfile: src/main/docker/Dockerfile.jvmlocal
container_name: sticker-catalogue
depends_on:
sticker-catalogue-db:
condition: service_healthy
kafka:
condition: service_healthy
minio:
condition: service_healthy
minio-init:
condition: service_completed_successfully
environment:
# Quarkus profile - use prod-kafka for Kafka messaging
QUARKUS_PROFILE: prod-kafka
# OAuth/JWT configuration
# OAUTH_ISSUER: Expected issuer claim in JWT tokens (external URL that user-management advertises)
OAUTH_ISSUER: ${DEPLOYMENT_HOST_URL:-http://localhost:8080}/
# MP_JWT_VERIFY_PUBLICKEY_LOCATION: Internal URL to fetch JWKS for signature verification
MP_JWT_VERIFY_PUBLICKEY_LOCATION: http://user-management:8080/.well-known/jwks
# DataDog APM configuration
DD_SERVICE: sticker-catalogue
DD_ENV: ${ENV:-development}
DD_VERSION: ${COMMIT_SHA:-latest}
DD_AGENT_HOST: datadog-agent
DD_DATA_STREAMS_ENABLED: "true"
DD_TRACE_REMOVE_INTEGRATION_SERVICE_NAMES_ENABLED: "true"
# Database configuration
QUARKUS_DATASOURCE_JDBC_URL: jdbc:postgresql://sticker-catalogue-db:5432/sticker_catalogue
QUARKUS_DATASOURCE_USERNAME: sticker_user
QUARKUS_DATASOURCE_PASSWORD: sticker_password
QUARKUS_DATASOURCE_DB_KIND: postgresql
# Kafka configuration
KAFKA_BOOTSTRAP_SERVERS: kafka:29092
MP_MESSAGING_CONNECTOR_SMALLRYE_KAFKA_BOOTSTRAP_SERVERS: kafka:29092
# S3/MinIO configuration
QUARKUS_S3_ENDPOINT_OVERRIDE: http://minio:9000
QUARKUS_S3_AWS_REGION: us-east-1
QUARKUS_S3_AWS_CREDENTIALS_TYPE: static
QUARKUS_S3_AWS_CREDENTIALS_STATIC_PROVIDER_ACCESS_KEY_ID: minioadmin
QUARKUS_S3_AWS_CREDENTIALS_STATIC_PROVIDER_SECRET_ACCESS_KEY: minioadmin
QUARKUS_S3_PATH_STYLE_ACCESS: "true"
STICKER_IMAGES_BUCKET: sticker-images
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/api/stickers/v1/"]
interval: 5s
timeout: 5s
retries: 3
start_period: 60s
labels:
- "traefik.enable=true"
- "traefik.http.routers.sticker-catalogue.rule=PathPrefix(`/api/stickers`)"
- "traefik.http.routers.sticker-catalogue.priority=100"
- "traefik.http.services.sticker-catalogue.loadbalancer.server.port=8080"
print-service:
build:
context: ./print-service
dockerfile: src/Stickerlandia.PrintService.Api/Dockerfile
container_name: print-service
depends_on:
kafka:
condition: service_healthy
print-service-db-migrations:
condition: service_completed_successfully
user-management:
condition: service_healthy
environment:
# DataDog APM configuration
DD_SERVICE: print-service
DD_ENV: ${ENV:-development}
DD_VERSION: ${COMMIT_SHA:-latest}
DD_AGENT_HOST: datadog-agent
DD_DATA_STREAMS_ENABLED: "true"
DD_TRACE_OTEL_ENABLED: "true"
DD_LOGS_INJECTION: "true"
DD_RUNTIME_METRICS_ENABLED: "true"
DD_PROFILING_ENABLED: "true"
OTEL_EXPORTER_OTLP_ENDPOINT: "http://datadog-agent:4317"
OTEL_SERVICE_NAME: "print-service"
# Application configuration
ASPNETCORE_ENVIRONMENT: Development
DRIVING: AGNOSTIC
DRIVEN: AGNOSTIC
DISABLE_SSL: "true"
ConnectionStrings__messaging: "kafka:29092"
ConnectionStrings__database: "Host=print-service-db;Port=5432;Database=print_service;Username=print_service_user;Password=print_service_password"
KAFKA__BOOTSTRAPSERVERS: "kafka:9092"
KAFKA__SCHEMAREGISTRY: "http://kafka:8082"
KAFKA__GROUPID: "stickerlandia-print"
Authentication__Audience: "stickerlandia"
Authentication__Authority: ${DEPLOYMENT_HOST_URL}
Authentication__MetadataAddress: "http://user-management:8080"
Authentication__Mode: "OidcDiscovery"
Authentication__RequireHttpsMetadata: "false"
OPENIDDICT_ISSUER: ${DEPLOYMENT_HOST_URL}
DEPLOYMENT_HOST_URL: ${DEPLOYMENT_HOST_URL}
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/api/print/v1/health"]
interval: 120s
timeout: 15s
retries: 10
labels:
- "traefik.enable=true"
- "traefik.http.routers.print-service.rule=PathPrefix(`/api/print`)"
- "traefik.http.routers.print-service.priority=100"
- "traefik.http.services.print-service.loadbalancer.server.port=8080"
print-service-worker:
build:
context: ./print-service
dockerfile: src/Stickerlandia.PrintService.Worker/Dockerfile
container_name: print-service-worker
depends_on:
kafka:
condition: service_healthy
print-service-db-migrations:
condition: service_completed_successfully
user-management:
condition: service_healthy
environment:
# DataDog APM configuration
DD_SERVICE: print-service
DD_ENV: ${ENV:-development}
DD_VERSION: ${COMMIT_SHA:-latest}
DD_AGENT_HOST: datadog-agent
DD_DATA_STREAMS_ENABLED: "true"
DD_TRACE_OTEL_ENABLED: "true"
DD_LOGS_INJECTION: "true"
DD_RUNTIME_METRICS_ENABLED: "true"
DD_PROFILING_ENABLED: "true"
OTEL_EXPORTER_OTLP_ENDPOINT: "http://datadog-agent:4317"
OTEL_SERVICE_NAME: "print-service"
# Application configuration
ASPNETCORE_ENVIRONMENT: Development
DRIVING: AGNOSTIC
DRIVEN: AGNOSTIC
DISABLE_SSL: "true"
ConnectionStrings__messaging: "kafka:29092"
ConnectionStrings__database: "Host=print-service-db;Port=5432;Database=print_service;Username=print_service_user;Password=print_service_password"
KAFKA__BOOTSTRAPSERVERS: "kafka:9092"
KAFKA__SCHEMAREGISTRY: "http://kafka:8082"
KAFKA__GROUPID: "stickerlandia-print"
Authentication__Audience: "stickerlandia"
Authentication__Authority: ${DEPLOYMENT_HOST_URL}
Authentication__MetadataAddress: "http://user-management:8080"
Authentication__Mode: "OidcDiscovery"
Authentication__RequireHttpsMetadata: "false"
OPENIDDICT_ISSUER: ${DEPLOYMENT_HOST_URL}
DEPLOYMENT_HOST_URL: ${DEPLOYMENT_HOST_URL}
print-service-client:
build:
context: ./print-service
dockerfile: src/Stickerlandia.PrintService.Client/Dockerfile
container_name: print-service-client
depends_on:
print-service:
condition: service_healthy
ports:
- "8086:8080"
environment:
# DataDog APM configuration
DD_SERVICE: print-service-client
DD_ENV: ${ENV:-development}
DD_VERSION: ${COMMIT_SHA:-latest}
DD_AGENT_HOST: datadog-agent
DD_DATA_STREAMS_ENABLED: "true"
DD_TRACE_OTEL_ENABLED: "true"
DD_LOGS_INJECTION: "true"
DD_RUNTIME_METRICS_ENABLED: "true"
DD_PROFILING_ENABLED: "true"
OTEL_EXPORTER_OTLP_ENDPOINT: "http://datadog-agent:4317"
OTEL_SERVICE_NAME: "print-service-client"
# Application configuration
ASPNETCORE_ENVIRONMENT: Development
DEFAULT_BACKEND_URL: http://print-service:8080
DEFAULT_PRINTER_KEY: "thisisadefaultkey"
print-service-db-migrations:
build:
context: ./print-service
dockerfile: src/Stickerlandia.PrintService.MigrationService/Dockerfile
container_name: print-service-migrations
depends_on:
print-service-db:
condition: service_healthy
kafka:
condition: service_healthy
environment:
# DataDog APM configuration
DD_SERVICE: print-service-migration-service
DD_ENV: development
DD_VERSION: ${COMMIT_SHA:-latest}
DD_AGENT_HOST: datadog-agent
DD_TRACE_OTEL_ENABLED: "true"
DD_LOGS_INJECTION: "true"
DD_RUNTIME_METRICS_ENABLED: "true"
ASPNETCORE_ENVIRONMENT: Development
DRIVING: AGNOSTIC
DRIVEN: AGNOSTIC
ConnectionStrings__messaging: "kafka:29092"
ConnectionStrings__database: "Host=print-service-db;Port=5432;Database=print_service;Username=print_service_user;Password=print_service_password"
KAFKA__BOOTSTRAPSERVERS: "kafka:9092"
KAFKA__SCHEMAREGISTRY: "http://kafka:8082"
KAFKA__GROUPID: "stickerlandia-print"
DEPLOYMENT_HOST_URL: ${DEPLOYMENT_HOST_URL}
command: ["migrations/Stickerlandia.PrintService.MigrationService.dll"]
user-management:
build:
context: ./user-management
dockerfile: src/Stickerlandia.UserManagement.Api/Dockerfile
container_name: user-management
depends_on:
user-management-db:
condition: service_healthy
kafka:
condition: service_healthy
user-management-db-migrations:
condition: service_completed_successfully
environment:
# DataDog APM configuration
DD_SERVICE: user-management
DD_ENV: ${ENV:-development}
DD_VERSION: ${COMMIT_SHA:-latest}
DD_AGENT_HOST: datadog-agent
DD_DATA_STREAMS_ENABLED: true
DD_TRACE_OTEL_ENABLED: "true"
DD_LOGS_INJECTION: "true"
DD_RUNTIME_METRICS_ENABLED: "true"
# The .NET profiler does not support ARM64, this won't work if running on Apple Silicon Macs
DD_PROFILING_ENABLED: "true"
# Required for Datadog .NET Continuous Profiler (x64 only)
LD_PRELOAD: /opt/datadog/linux-x64/Datadog.Linux.ApiWrapper.x64.so
# Application configuration
ASPNETCORE_ENVIRONMENT: Development
DRIVING: AGNOSTIC
DRIVEN: AGNOSTIC
DISABLE_SSL: "true"
# Rate limiting disabled by default in development
RateLimiting__Enabled: "false"
ConnectionStrings__messaging: "kafka:29092"
ConnectionStrings__database: "Host=user-management-db;Port=5432;Database=user_management;Username=user_mgmt_user;Password=user_mgmt_password"
KAFKA__BOOTSTRAPSERVERS: "kafka:29092"
KAFKA__SCHEMAREGISTRY: "http://kafka:8082"
KAFKA__GROUPID: "stickerlandia-user-management"
OPENIDDICT_ISSUER: ${DEPLOYMENT_HOST_URL}
DEPLOYMENT_HOST_URL: ${DEPLOYMENT_HOST_URL}
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/api/users/v1/health"]
interval: 1s
timeout: 15s
retries: 10
labels:
- "traefik.enable=true"
- "traefik.http.routers.user-management.rule=PathPrefix(`/api/users`)"
- "traefik.http.routers.user-management.priority=100"
- "traefik.http.routers.auth.rule=PathRegexp(`(?i)^/auth`)"
- "traefik.http.routers.auth.priority=100"
- "traefik.http.routers.oidc-discovery.rule=PathPrefix(`/.well-known`)"
- "traefik.http.routers.oidc-discovery.priority=100"
- "traefik.http.routers.oidc-discovery.service=user-management"
- "traefik.http.services.user-management.loadbalancer.server.port=8080"
user-management-worker:
build:
context: ./user-management
dockerfile: src/Stickerlandia.UserManagement.Worker/Dockerfile
container_name: user-management-worker
depends_on:
user-management-db:
condition: service_healthy
kafka:
condition: service_healthy
environment:
# DataDog APM configuration
DD_SERVICE: user-management-worker
DD_ENV: ${ENV:-development}
DD_VERSION: ${COMMIT_SHA:-latest}
DD_AGENT_HOST: datadog-agent
DD_DATA_STREAMS_ENABLED: true
DD_TRACE_OTEL_ENABLED: "true"
DD_LOGS_INJECTION: "true"
DD_RUNTIME_METRICS_ENABLED: "true"
# The .NET profiler does not support ARM64, this won't work if running on Apple Silicon Macs
DD_PROFILING_ENABLED: "true"
# Required for Datadog .NET Continuous Profiler (x64 only)
LD_PRELOAD: /opt/datadog/linux-x64/Datadog.Linux.ApiWrapper.x64.so
ASPNETCORE_ENVIRONMENT: Development
DRIVING: AGNOSTIC
DRIVEN: AGNOSTIC
ConnectionStrings__messaging: "kafka:29092"
ConnectionStrings__database: "Host=user-management-db;Port=5432;Database=user_management;Username=user_mgmt_user;Password=user_mgmt_password"
KAFKA__BOOTSTRAPSERVERS: "kafka:29092"
KAFKA__SCHEMAREGISTRY: "http://kafka:8082"
KAFKA__GROUPID: "stickerlandia-user-management"
command: ["worker/Stickerlandia.UserManagement.Worker.dll"]
user-management-db-migrations:
build:
context: ./user-management
dockerfile: src/Stickerlandia.UserManagement.MigrationService/Dockerfile
container_name: user-management-migrations
depends_on:
user-management-db:
condition: service_healthy
kafka:
condition: service_healthy
environment:
# DataDog APM configuration
DD_SERVICE: user-management-migration-service
DD_ENV: ${ENV:-development}
DD_VERSION: ${COMMIT_SHA:-latest}
DD_AGENT_HOST: datadog-agent
DD_TRACE_OTEL_ENABLED: "true"
DD_LOGS_INJECTION: "true"
DD_RUNTIME_METRICS_ENABLED: "true"
# The .NET profiler does not support ARM64, this won't work if running on Apple Silicon Macs
DD_PROFILING_ENABLED: "true"
# Required for Datadog .NET Continuous Profiler (x64 only)
LD_PRELOAD: /opt/datadog/linux-x64/Datadog.Linux.ApiWrapper.x64.so
ASPNETCORE_ENVIRONMENT: Development
DRIVING: AGNOSTIC
DRIVEN: AGNOSTIC
ConnectionStrings__messaging: "kafka:29092"
ConnectionStrings__database: "Host=user-management-db;Port=5432;Database=user_management;Username=user_mgmt_user;Password=user_mgmt_password"
KAFKA__BOOTSTRAPSERVERS: "kafka:29092"
KAFKA__SCHEMAREGISTRY: "http://kafka:8082"
KAFKA__GROUPID: "stickerlandia-user-management"
DEPLOYMENT_HOST_URL: ${DEPLOYMENT_HOST_URL}
command: ["migrations/Stickerlandia.UserManagement.MigrationService.dll"]
web-backend:
build:
context: ./web-backend
dockerfile: Dockerfile
container_name: web-backend
depends_on:
user-management:
condition: service_healthy
environment:
# DataDog APM configuration
DD_SERVICE: web-backend
DD_ENV: ${ENV:-development}
DD_VERSION: ${COMMIT_SHA:-latest}
DD_AGENT_HOST: datadog-agent
# Application configuration
NODE_ENV: development
# Rate limiting disabled by default in development
SKIP_RATE_LIMIT: "true"
OAUTH_ISSUER_INTERNAL: http://user-management:8080
OAUTH_CLIENT_ID: web-ui
OAUTH_CLIENT_SECRET: stickerlandia-web-ui-secret-2025
DEPLOYMENT_HOST_URL: ${DEPLOYMENT_HOST_URL}
labels:
- "traefik.enable=true"
- "traefik.http.routers.web-backend.rule=PathPrefix(`/api/app`)"
- "traefik.http.routers.web-backend.priority=100"
- "traefik.http.services.web-backend.loadbalancer.server.port=3000"
web-frontend:
build:
context: ./web-frontend
dockerfile: Dockerfile
environment:
# Application configuration
NODE_ENV: production
# Datadog RUM configuration (runtime injection via vite-envs)
DD_RUM_APPLICATION_ID: ${DD_RUM_APPLICATION_ID}
DD_RUM_CLIENT_TOKEN: ${DD_RUM_CLIENT_TOKEN}
DD_SITE: ${DD_SITE:-datadoghq.eu}
DD_ENV: ${ENV:-development}
DD_VERSION: ${COMMIT_SHA:-latest}
DD_SERVICE: web-frontend
labels:
- "traefik.enable=true"
- "traefik.http.routers.web-frontend.rule=PathPrefix(`/`)"
- "traefik.http.routers.web-frontend.priority=1"
- "traefik.http.services.web-frontend.loadbalancer.server.port=80"
# Enable browser profiling for Datadog RUM
# See: https://docs.datadoghq.com/real_user_monitoring/correlate_with_other_telemetry/profiling/browser_profiling/
- "traefik.http.middlewares.document-policy.headers.customresponseheaders.Document-Policy=js-profiling"
- "traefik.http.routers.web-frontend.middlewares=document-policy"
sticker-award:
build:
context: ./sticker-award
dockerfile: Dockerfile
container_name: sticker-award
depends_on:
sticker-catalogue:
condition: service_healthy
sticker-award-db:
condition: service_healthy
kafka:
condition: service_healthy
kafka-init:
condition: service_completed_successfully
environment:
# DataDog APM configuration
DD_SERVICE: sticker-award
DD_ENV: ${ENV:-development}
DD_VERSION: ${COMMIT_SHA:-latest}
DD_AGENT_HOST: datadog-agent
DD_DATA_STREAMS_ENABLED: true
# Server configuration
SERVER_PORT: 8080
# Database configuration
DATABASE_HOST: sticker-award-db
DATABASE_PORT: 5432
DATABASE_USER: sticker_user
DATABASE_PASSWORD: sticker_password
DATABASE_NAME: sticker_awards
DATABASE_SSL_MODE: disable
# Logging configuration
LOG_LEVEL: info
LOG_FORMAT: json
# Kafka configuration
KAFKA_BROKERS: kafka:29092
KAFKA_GROUP_ID: sticker-award-service
# External service configuration
CATALOGUE_BASE_URL: http://sticker-catalogue:8080
# OAuth/JWT configuration
# OAUTH_ISSUER: The issuer claim expected in JWT tokens (matches what user-management sets)
# Note: OpenIddict adds trailing slash to issuer, so we must include it here
# OAUTH_JWKS_URL: Internal Docker network URL to fetch JWKS for token validation
OAUTH_ISSUER: ${DEPLOYMENT_HOST_URL}/
OAUTH_JWKS_URL: http://user-management:8080/.well-known/jwks
healthcheck:
test:
[
"CMD",
"wget",
"--no-verbose",
"--tries=1",
"--spider",
"http://localhost:8080/health",
]
interval: 1s
timeout: 10s
retries: 3
start_period: 40s
labels:
- "traefik.enable=true"
- "traefik.http.routers.sticker-award.rule=PathPrefix(`/api/awards`)"
- "traefik.http.routers.sticker-award.priority=100"
- "traefik.http.services.sticker-award.loadbalancer.server.port=8080"
# Load testing service - runs k6 load tests against the stack
load-simulator:
image: grafana/k6:latest
volumes:
- ./load-tests:/scripts
environment:
- TARGET_URL=http://traefik:80
- DEPLOYMENT_HOST_URL=${DEPLOYMENT_HOST_URL:-http://localhost:8080}
- WORKLOAD=${WORKLOAD:-smoke}
- SCENARIO=${SCENARIO:-mixed}
- TEST_EMAIL=${TEST_EMAIL:-user@stickerlandia.com}
- TEST_PASSWORD=${TEST_PASSWORD:-Stickerlandia2025!}
command: run /scripts/load-test.js
depends_on:
traefik:
condition: service_healthy
user-management:
condition: service_healthy
sticker-catalogue:
condition: service_healthy
sticker-award:
condition: service_healthy
web-backend:
condition: service_started
profiles:
- load-test
datadog-agent:
image: datadog/agent:7.75.0
pull_policy: always
container_name: datadog-agent
pid: host
profiles:
- monitoring
- load-test
ports:
- "8126:8126"
- "4317:4317"
- "4318:4318"
expose:
- "8126" # APM tracing port
- "4317" # OTLP gRPC port for OpenTelemetry
- "4318" # OTLP HTTP port for OpenTelemetry
environment:
# Core Datadog configuration
- DD_API_KEY=${DD_API_KEY}
- DD_SITE=${DD_SITE:-datadoghq.eu}
- DD_HOSTNAME=stickerlandia-dev
- DD_TAGS=env:development,project:stickerlandia
# APM (Application Performance Monitoring) configuration
- DD_APM_ENABLED=true
- DD_APM_NON_LOCAL_TRAFFIC=true
- DD_APM_RECEIVER_PORT=8126
# Profiling enabled
- DD_PROFILING_ENABLED=true
# Log collection configuration
- DD_LOGS_ENABLED=true
- DD_LOGS_CONFIG_CONTAINER_COLLECT_ALL=true
- DD_LOGS_CONFIG_AUTO_MULTI_LINE_DETECTION=true
# Container monitoring
- DD_CONTAINER_EXCLUDE_LOGS=name:datadog-agent
- DD_CONTAINER_EXCLUDE_METRICS=name:datadog-agent
# OTLP configuration for OpenTelemetry
- DD_OTELCOLLECTOR_ENABLED=true
- DD_OTLP_CONFIG_RECEIVER_PROTOCOLS_GRPC_ENDPOINT=0.0.0.0:4317
- DD_OTLP_CONFIG_RECEIVER_PROTOCOLS_HTTP_ENDPOINT=0.0.0.0:4318
# Docker integration
- DD_DOCKER_LABELS_AS_TAGS=true
- DD_DOCKER_ENV_AS_TAGS=true
volumes:
# Docker socket for container monitoring
- /var/run/docker.sock:/var/run/docker.sock:ro
# System directories for host metrics
- /proc/:/host/proc/:ro
- /sys/fs/cgroup/:/host/sys/fs/cgroup:ro
configs:
- source: kafka_consumer_config
target: /etc/datadog-agent/conf.d/kafka_consumer.d/conf.yaml
- source: postgres_config
target: /etc/datadog-agent/conf.d/postgres.d/conf.yaml
restart: unless-stopped
healthcheck:
test: ["CMD", "agent", "health"]
interval: 2s
timeout: 30s
retries: 20
start_period: 40s
depends_on:
kafka:
condition: service_healthy
volumes:
sticker-catalogue-data:
sticker-award-data:
print-service-data:
user-management-data:
kafka-data:
minio-data:
configs:
kafka_consumer_config:
content: |
init_config:
instances:
- enable_cluster_monitoring: true
kafka_connect_str: kafka:29092
monitor_unlisted_consumer_groups: true
postgres_config:
content: |
init_config:
instances:
- dbm: true
host: user-management-db
port: 5432
username: datadog
password: datadog_password
dbname: user_management
- dbm: true
host: sticker-award-db
port: 5432
username: datadog
password: datadog_password
dbname: sticker_awards
- dbm: true
host: sticker-catalogue-db
port: 5432
username: datadog
password: datadog_password
dbname: sticker_catalogue
- dbm: true
host: print-service-db
port: 5432
username: datadog
password: datadog_password
dbname: print_service