-
Notifications
You must be signed in to change notification settings - Fork 5
/
compose.yml
422 lines (406 loc) · 11.8 KB
/
compose.yml
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
services:
config-server:
image: config-server:latest
hostname: config-server
container_name: config-server
build:
context: .
dockerfile: ./config-server/src/main/docker/Dockerfile
args:
UID: ${UID:-1000}
GID: ${GID:-1000}
environment:
SPRING_PROFILES_ACTIVE: default,native,docker,json-logging
OTEL_JAVAAGENT_ENABLED: false
OTEL_SERVICE_NAME: config-server
OTEL_EXPORTER_OTLP_ENDPOINT: http://collector:4317
OTEL_EXPORTER_OTLP_PROTOCOL: grpc
OTEL_RESOURCE_ATTRIBUTES: "source=agent"
volumes:
- ./logs:/logs
ports:
- 8888:8888
healthcheck:
test: curl --fail http://localhost:8890/actuator/health
interval: 5s
timeout: 4s
retries: 10
start_period: 5s
discovery-server:
image: discovery-server:latest
hostname: discovery-server
container_name: discovery-server
build:
context: .
dockerfile: ./discovery-server/src/main/docker/Dockerfile
args:
UID: ${UID:-1000}
GID: ${GID:-1000}
ports:
- 8761:8761
environment:
CONFIG_SERVER_URL: http://config-server:8888
SPRING_PROFILES_ACTIVE: default,docker,json-logging
OTEL_SERVICE_NAME: discovery-server
OTEL_EXPORTER_OTLP_ENDPOINT: http://collector:4317
OTEL_EXPORTER_OTLP_PROTOCOL: grpc
OTEL_RESOURCE_ATTRIBUTES: "source=agent"
volumes:
- ./logs:/logs
depends_on:
config-server:
condition: service_healthy
healthcheck:
test: curl --fail http://localhost:8761/actuator/health
interval: 5s
timeout: 4s
retries: 10
start_period: 5s
api-gateway:
image: api-gateway:latest
hostname: api-gateway
container_name: api-gateway
build:
context: .
dockerfile: ./api-gateway/src/main/docker/Dockerfile
args:
UID: ${UID:-1000}
GID: ${GID:-1000}
ports:
- 8080:8080
environment:
CONFIG_SERVER_URL: http://config-server:8888
#SPRING_PROFILES_ACTIVE: default,docker
#SPRING_PROFILES_ACTIVE: default,docker,logfmt-logging
SPRING_PROFILES_ACTIVE: default,docker,json-logging
OTEL_SERVICE_NAME: api-gateway
OTEL_EXPORTER_OTLP_ENDPOINT: http://collector:4317
OTEL_EXPORTER_OTLP_PROTOCOL: grpc
OTEL_RESOURCE_ATTRIBUTES: "source=agent"
volumes:
- ./logs:/logs
depends_on:
config-server:
condition: service_healthy
discovery-server:
condition: service_healthy
healthcheck:
test: curl --fail http://localhost:8080/actuator/health
interval: 5s
timeout: 4s
retries: 10
start_period: 5s
easypay-service:
image: easypay-service:latest
hostname: easypay-service
container_name: easypay-service
build:
context: .
dockerfile: ./easypay-service/src/main/docker/Dockerfile
args:
UID: ${UID:-1000}
GID: ${GID:-1000}
environment:
CONFIG_SERVER_URL: http://config-server:8888
SPRING_PROFILES_ACTIVE: default,docker
OTEL_SERVICE_NAME: easypay-service
OTEL_EXPORTER_OTLP_ENDPOINT: http://collector:4317
OTEL_EXPORTER_OTLP_PROTOCOL: grpc
OTEL_RESOURCE_ATTRIBUTES: "source=agent"
volumes:
- ./logs:/logs
depends_on:
config-server:
condition: service_healthy
discovery-server:
condition: service_healthy
postgres-easypay:
condition: service_healthy
healthcheck:
test: curl --fail http://localhost:8080/actuator/health
interval: 5s
timeout: 4s
retries: 10
start_period: 5s
smartbank-gateway:
image: smartbank-gateway:latest
hostname: smartbank-gateway
container_name: smartbank-gateway
build:
context: .
dockerfile: ./smartbank-gateway/src/main/docker/Dockerfile
args:
UID: ${UID:-1000}
GID: ${GID:-1000}
environment:
CONFIG_SERVER_URL: http://config-server:8888
SPRING_PROFILES_ACTIVE: default,docker
OTEL_SERVICE_NAME: smartbank-gateway
OTEL_EXPORTER_OTLP_ENDPOINT: http://collector:4317
OTEL_EXPORTER_OTLP_PROTOCOL: grpc
OTEL_RESOURCE_ATTRIBUTES: "source=agent"
volumes:
- ./logs:/logs
depends_on:
config-server:
condition: service_healthy
discovery-server:
condition: service_healthy
postgres-smartbank:
condition: service_healthy
healthcheck:
test: curl --fail http://localhost:8080/actuator/health
interval: 5s
timeout: 4s
retries: 10
start_period: 5s
fraudetect-service:
image: fraudetect-service:latest
hostname: fraudetect
container_name: fraudetect
build:
context: .
dockerfile: ./fraudetect-service/src/main/docker/Dockerfile
args:
UID: ${UID:-1000}
GID: ${GID:-1000}
environment:
CONFIG_SERVER_URL: http://config-server:8888
#SPRING_PROFILES_ACTIVE: default,docker
#SPRING_PROFILES_ACTIVE: default,docker,logfmt-logging
SPRING_PROFILES_ACTIVE: default,docker,json-logging
SERVER_PORT: 8080
OTEL_SERVICE_NAME: fraudetect-service
OTEL_EXPORTER_OTLP_ENDPOINT: http://collector:4317
OTEL_EXPORTER_OTLP_PROTOCOL: grpc
OTEL_RESOURCE_ATTRIBUTES: "source=agent"
volumes:
- ./logs:/logs
depends_on:
config-server:
condition: service_healthy
discovery-server:
condition: service_healthy
postgres-fraudetect:
condition: service_healthy
kafka:
condition: service_healthy
healthcheck:
test: curl --fail http://localhost:8080/actuator/health
interval: 3s
timeout: 1s
retries: 5
start_period: 3s
merchant-backoffice:
image: merchant-backoffice:latest
hostname: merchant-backoffice
container_name: merchant-backoffice
build:
context: .
dockerfile: ./merchant-backoffice/src/main/docker/Dockerfile
args:
UID: ${UID:-1000}
GID: ${GID:-1000}
environment:
CONFIG_SERVER_URL: http://config-server:8888
SPRING_PROFILES_ACTIVE: default,docker,json-logging
OTEL_SERVICE_NAME: merchant-backoffice
OTEL_EXPORTER_OTLP_ENDPOINT: http://collector:4317
OTEL_EXPORTER_OTLP_PROTOCOL: grpc
OTEL_RESOURCE_ATTRIBUTES: "source=agent"
volumes:
- ./logs:/logs
depends_on:
config-server:
condition: service_healthy
discovery-server:
condition: service_healthy
postgres-merchantbo:
condition: service_healthy
kafka:
condition: service_healthy
healthcheck:
test: curl --fail http://localhost:8080/actuator/health
interval: 3s
timeout: 1s
retries: 5
start_period: 3s
collector:
image: grafana/alloy:latest
volumes:
- ./logs:/logs
- ./docker/alloy/config.alloy:/etc/alloy/config.alloy
ports:
- 4317:4317
- 4318:4318
- 12345:12345
command:
- run
- --server.http.listen-addr=0.0.0.0:12345
- /etc/alloy/config.alloy
loki:
image: grafana/loki:latest
ports:
- 3100:3100
volumes:
- ./docker/loki/local-config.yaml:/etc/loki/local-config.yaml
command:
- -config.file=/etc/loki/local-config.yaml
prometheus:
image: prom/prometheus:v2.52.0
ports:
- "9090:9090"
volumes:
- ./docker/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
command:
- --config.file=/etc/prometheus/prometheus.yml
- --web.enable-lifecycle
- --web.enable-remote-write-receiver
- --enable-feature=otlp-write-receiver
- --enable-feature=exemplar-storage
tempo:
image: grafana/tempo:latest
ports:
- "14268:14268" # jaeger ingest
- "3200:3200" # tempo
- "9095:9095" # tempo grpc
- "9411:9411" # zipkin
volumes:
- ./docker/tempo/config.yaml:/etc/tempo/config.yaml
command:
- -config.file=/etc/tempo/config.yaml
grafana:
environment:
- GF_PATHS_PROVISIONING=/etc/grafana/provisioning
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
volumes:
- ./docker/grafana/datasources:/etc/grafana/provisioning/dashboards
entrypoint:
- sh
- -xeuc
- |
mkdir -p /etc/grafana/provisioning/datasources
cat <<EOF > /etc/grafana/provisioning/datasources/ds.yaml
apiVersion: 1
datasources:
- name: Loki
type: loki
access: proxy
orgId: 1
url: http://loki:3100
basicAuth: false
isDefault: true
version: 1
editable: true
- name: Prometheus
type: prometheus
uid: prometheus
access: proxy
orgId: 1
url: http://prometheus:9090
basicAuth: false
isDefault: false
version: 1
editable: true
- name: Tempo
type: tempo
access: proxy
orgId: 1
url: http://tempo:3200
basicAuth: false
isDefault: false
version: 1
editable: true
apiVersion: 1
uid: tempo
jsonData:
httpMethod: GET
serviceMap:
datasourceUid: prometheus
EOF
/run.sh
image: grafana/grafana:latest
ports:
- "3000:3000"
postgres-easypay:
image: postgres:16
ports:
- "5432:5432"
environment:
POSTGRES_DB: easypay
POSTGRES_USER: easypay
POSTGRES_PASSWORD: easypay
healthcheck:
test: ["CMD-SHELL", "pg_isready -U easypay"]
interval: 5s
timeout: 1s
retries: 5
postgres-smartbank:
image: postgres:16
ports:
- "5433:5432"
environment:
POSTGRES_DB: smartbank
POSTGRES_USER: smartbank
POSTGRES_PASSWORD: smartbank
healthcheck:
test: ["CMD-SHELL", "pg_isready -U smartbank"]
interval: 5s
timeout: 1s
retries: 5
postgres-fraudetect:
image: postgres:16
ports:
- "5434:5432"
environment:
POSTGRES_DB: fraudetect
POSTGRES_USER: fraudetect
POSTGRES_PASSWORD: fraudetect
healthcheck:
test: ["CMD-SHELL", "pg_isready -U fraudetect"]
interval: 5s
timeout: 1s
retries: 5
postgres-merchantbo:
image: postgres:16
ports:
- "5435:5432"
environment:
POSTGRES_DB: merchantbo
POSTGRES_USER: merchantbo
POSTGRES_PASSWORD: merchantbo
healthcheck:
test: ["CMD-SHELL", "pg_isready -U merchantbo"]
interval: 5s
timeout: 1s
retries: 5
kafka:
image: confluentinc/cp-kafka:7.6.1
hostname: kafka
container_name: kafka
ports:
- "19092:19092"
environment:
KAFKA_NODE_ID: 1
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: 'CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT'
KAFKA_ADVERTISED_LISTENERS: 'PLAINTEXT://kafka:9092,PLAINTEXT_HOST://localhost:19092'
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_JMX_HOSTNAME: localhost
KAFKA_PROCESS_ROLES: 'broker,controller'
KAFKA_CONTROLLER_QUORUM_VOTERS: '1@kafka:29093'
KAFKA_LISTENERS: 'PLAINTEXT://kafka:9092,CONTROLLER://kafka:29093,PLAINTEXT_HOST://0.0.0.0:19092'
KAFKA_INTER_BROKER_LISTENER_NAME: 'PLAINTEXT'
KAFKA_CONTROLLER_LISTENER_NAMES: 'CONTROLLER'
KAFKA_LOG_DIRS: '/tmp/kraft-combined-logs'
# Replace CLUSTER_ID with a unique base64 UUID using "bin/kafka-storage.sh random-uuid"
# See https://docs.confluent.io/kafka/operations-tools/kafka-tools.html#kafka-storage-sh
CLUSTER_ID: 'MkU3OEVBNTcwNTJENDM2Qk'
healthcheck:
test: ["CMD-SHELL", "kafka-topics --bootstrap-server kafka:9092 --list"]
interval: 30s
timeout: 10s
retries: 5