-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdocker-compose.yml
413 lines (396 loc) · 11.7 KB
/
docker-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
version: "3.7"
networks:
mojaloop-net:
name: mojaloop-net
services:
## Switch
central-ledger:
image: mojaloop/central-ledger:${CENTRAL_LEDGER_VERSION}
container_name: central-ledger
command: sh -c "/opt/app/config-modifier/run.js /opt/app/config/default.json /opt/app/config-modifier/configs/central-ledger.js /opt/app/config/default.json && /opt/app/wait4/wait4.js central-ledger && node src/api/index.js"
# ports:
# - "3001:3001"
volumes:
- ./docker/wait4:/opt/app/wait4
- ./docker/config-modifier:/opt/app/config-modifier
environment:
- LOG_LEVEL=info
- CLEDG_MONGODB__DISABLED=false
networks:
- mojaloop-net
depends_on:
mysql:
condition: service_started
kafka:
condition: service_started
objstore:
condition: service_healthy
healthcheck:
test: wget -q http://localhost:3001/health -O /dev/null || exit 1
timeout: 20s
retries: 30
interval: 30s
start_period: 30s
user: root
profiles:
- central-ledger
- transfer
- discovery
- agreement
- all-services
- simple
objstore:
image: mongo:${DEP_MONGO_VERSION}
container_name: objstore
ports:
- "27017:27017"
networks:
- mojaloop-net
healthcheck:
test: mongosh --eval 'db.runCommand("ping").ok' localhost:27017/test --quiet
interval: 10s
timeout: 10s
retries: 5
start_period: 40s
profiles:
- central-ledger
- transfer
- discovery
- agreement
- all-services
- simple
kafka-provisioning:
container_name: kafka-provisioning
networks:
- mojaloop-net
image: docker.io/bitnami/kafka:${DEP_KAFKA_VERSION}
depends_on:
- kafka
volumes:
- ./docker/kafka/scripts:/tmp/kafka/scripts
command: bash /tmp/kafka/scripts/provision.sh
profiles:
- central-ledger
- transfer
- discovery
- agreement
- all-services
- simple
kafka:
networks:
- mojaloop-net
image: docker.io/bitnami/kafka:${DEP_KAFKA_VERSION}
container_name: kafka
# ports:
# - "9092:9092"
environment:
# BITNAMI_DEBUG: "yes"
ALLOW_PLAINTEXT_LISTENER: "yes"
KAFKA_ADVERTISED_HOST_NAME: kafka
KAFKA_CFG_LISTENERS: CONTROLLER://:9093,LISTENER_DOCKER://kafka:29092,LISTENER_EXTERN://:9092
KAFKA_CFG_ADVERTISED_LISTENERS: LISTENER_DOCKER://kafka:29092,LISTENER_EXTERN://:9092
KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,LISTENER_DOCKER:PLAINTEXT,LISTENER_EXTERN:PLAINTEXT
KAFKA_CFG_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_CFG_MESSAGE_MAX_BYTES: 200000000
KAFKA_CFG_NODE_ID: 1
KAFKA_CFG_PROCESS_ROLES: broker,controller
KAFKA_CFG_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: [email protected]:9093
KAFKA_ENABLE_KRAFT: "true"
healthcheck:
test: ["CMD" ,"/opt/bitnami/kafka/bin/kafka-broker-api-versions.sh","--bootstrap-server","kafka:9092"]
timeout: 20s
retries: 10
start_period: 40s
interval: 30s
profiles:
- central-ledger
- transfer
- discovery
- agreement
- all-services
- simple
mysql:
image: mysql/mysql-server:${DEP_MYSQL_VERSION}
container_name: mysql
# ports:
# - "3306:3306"
volumes:
# Note: this fixes the permissions issue, but docker-compose up will fail on first attempt
- ./docker/sql-init/:/docker-entrypoint-initdb.d/
environment:
- MYSQL_USER=${DBUSER:-central_ledger}
- MYSQL_PASSWORD=${DBPASS:-password}
- MYSQL_DATABASE=${DBUSER:-central_ledger}
- MYSQL_ALLOW_EMPTY_PASSWORD=true
networks:
- mojaloop-net
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "mysql"]
timeout: 20s
retries: 10
start_period: 40s
interval: 30s
profiles:
- central-ledger
- transfer
- discovery
- agreement
- all-services
- simple
quoting-service:
image: "mojaloop/quoting-service:${QUOTING_SERVICE_VERSION}"
container_name: quoting-service
command: sh -c "/opt/app/config-modifier/run.js /opt/app/config/default.json /opt/app/config-modifier/configs/quoting-service.js /opt/app/config/default.json && node src/index.js"
networks:
- mojaloop-net
depends_on:
mysql:
condition: service_started
central-ledger:
condition: service_started
# ports:
# - "3002:3002"
volumes:
- ./docker/config-modifier:/opt/app/config-modifier
healthcheck:
test: wget -q http://0.0.0.0:3002/health -O /dev/null || exit 1
timeout: 20s
retries: 30
interval: 15s
user: root
profiles:
- quoting-service
- agreement
- all-services
- simple
ml-api-adapter:
image: mojaloop/ml-api-adapter:${ML_API_ADAPTER_VERSION}
container_name: ml-api-adapter
command: sh -c "/opt/app/config-modifier/run.js /opt/app/config/default.json /opt/app/config-modifier/configs/ml-api-adapter.js /opt/app/config/default.json && /opt/app/wait4/wait4.js ml-api-adapter && node src/api/index.js"
# ports:
# - "3000:3000"
volumes:
- ./docker/wait4:/opt/app/wait4
- ./docker/config-modifier:/opt/app/config-modifier
environment:
- LOG_LEVEL=info
networks:
- mojaloop-net
depends_on:
kafka:
condition: service_started
central-ledger:
condition: service_started
healthcheck:
test: wget -q http://localhost:3000/health -O /dev/null || exit 1
timeout: 30s
retries: 30
interval: 30s
start_period: 30s
user: root
profiles:
- ml-api-adapter
- transfer
- all-services
- simple
simulator:
image: mojaloop/simulator:${TEST_SIMULATOR_VERSION}
container_name: simulator
# ports:
# - "8444:8444"
environment:
- LOG_LEVEL=info
- TRANSFERS_ENDPOINT=http://ml-api-adapter:3000
- QUOTES_ENDPOINT=http://quoting-service:3002
- PARTIES_ENDPOINT=http://account-lookup-service:4002
- TRANSACTION_REQUESTS_ENDPOINT=http://transaction-request-service:4003
- TRANSFERS_FULFIL_RESPONSE_DISABLED=false
networks:
- mojaloop-net
healthcheck:
test: wget -q http://0.0.0.0:8444/health -O /dev/null || exit 1
timeout: 20s
retries: 10
interval: 30s
profiles:
- simulator
- discovery
- all-services
- simple
account-lookup-service:
image: mojaloop/account-lookup-service:${ACCOUNT_LOOKUP_SERVICE_VERSION}
container_name: account-lookup-service
command: sh -c "/opt/app/config-modifier/run.js /opt/app/config/default.json /opt/app/config-modifier/configs/account-lookup-service.js /opt/app/config/default.json && /opt/app/wait4/wait4.js account-lookup-service && npm run migrate && node src/index.js server"
# ports:
# - "4001:4001"
# - "4002:4002"
environment:
- LOG_LEVEL=info
- ALS_DISPLAY_ROUTES=false
- EVENT_SDK_TRACEID_PER_VENDOR=false
networks:
- mojaloop-net
depends_on:
mysql-als:
condition: service_started
central-ledger:
condition: service_started
simulator:
condition: service_healthy
volumes:
- ./docker/wait4:/opt/app/wait4
- ./docker/config-modifier:/opt/app/config-modifier
healthcheck:
test: wget -q http://localhost:4001/health -O /dev/null || exit 1
timeout: 20s
retries: 10
start_period: 40s
interval: 30s
user: root
profiles:
- account-lookup-service
- discovery
- all-services
- simple
mysql-als:
image: mysql/mysql-server:${DEP_MYSQL_VERSION}
container_name: mysql-als
# ports:
# - "3307:3306"
volumes:
- ./docker/sql-als-init/:/docker-entrypoint-initdb.d/
environment:
- MYSQL_USER=${DBUSER:-account_lookup}
- MYSQL_PASSWORD=${DBPASS:-password}
- MYSQL_DATABASE=${DBUSER:-account_lookup}
- MYSQL_ALLOW_EMPTY_PASSWORD=true
networks:
- mojaloop-net
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "mysql-als"]
timeout: 20s
retries: 10
start_period: 40s
interval: 30s
profiles:
- account-lookup-service
- discovery
- all-services
- simple
## Testing Toolkit
mojaloop-testing-toolkit:
image: mojaloop/ml-testing-toolkit:${TEST_TTK_SVC_VERSION}
volumes:
- "./docker/ml-testing-toolkit/spec_files:/opt/app/spec_files"
- "./docker/ml-testing-toolkit/test-cases:/opt/app/examples"
ports:
- "9440:4040"
- "9550:5050"
user: root
command:
- sh
- -c
- "npm start"
networks:
- mojaloop-net
healthcheck:
test: ["CMD-SHELL", "nc -z -v localhost 4040"]
interval: 5s
timeout: 10s
start_period: 10s
retries: 10
profiles:
- testing-toolkit
- all-services
- simple
mojaloop-testing-toolkit-ui:
image: mojaloop/ml-testing-toolkit-ui:${TEST_TTK_UI_VERSION}
ports:
- "9660:6060"
environment:
- API_BASE_URL=http://localhost:9550
- AUTH_ENABLED=FALSE
command:
- sh
- /usr/share/nginx/start.sh
networks:
- mojaloop-net
profiles:
- testing-toolkit
- all-services
- simple
ttk-provisioning:
image: mojaloop/ml-testing-toolkit-client-lib:${TEST_TTK_CLI_VERSION}
volumes:
- "./docker/ml-testing-toolkit/test-cases/collections:/opt/app/collections"
- "./docker/ml-testing-toolkit/test-cases/environments:/opt/app/environments"
- "./reports:/opt/app/reports"
depends_on:
mojaloop-testing-toolkit:
condition: service_healthy
central-ledger:
condition: service_healthy
ml-api-adapter:
condition: service_healthy
account-lookup-service:
condition: service_healthy
quoting-service:
condition: service_healthy
networks:
- mojaloop-net
command:
- sh
- -c
- "npm run cli -- -u http://mojaloop-testing-toolkit:5050 -l 2 -i collections/provisioning-simple -e environments/default-env-simple.json --save-report true --report-format html --report-target file://reports/ttk-provisioning-report.html"
user: root
profiles:
- ttk-provisioning
- simple
ttk-tests:
image: mojaloop/ml-testing-toolkit-client-lib:${TEST_TTK_CLI_VERSION}
volumes:
- "./docker/ml-testing-toolkit/test-cases/collections:/opt/app/collections"
- "./docker/ml-testing-toolkit/test-cases/environments:/opt/app/environments"
- "./reports:/opt/app/reports"
depends_on:
mojaloop-testing-toolkit:
condition: service_healthy
central-ledger:
condition: service_healthy
ml-api-adapter:
condition: service_healthy
account-lookup-service:
condition: service_healthy
quoting-service:
condition: service_healthy
ttk-provisioning:
condition: service_completed_successfully
networks:
- mojaloop-net
command:
- sh
- -c
- "npm run cli -- -u http://mojaloop-testing-toolkit:5050 -l 2 -i collections/tests -e environments/default-env.json --report-format html --save-report true --report-target file://reports/ttk-func-tests-report.html"
user: root
profiles:
- ttk-tests
- simple
## Debug utilities
kafka-debug-ui:
image: docker.redpanda.com/redpandadata/console:${DEP_KAfKA_UI_VERSION}
deploy:
replicas: 1
restart: on-failure
hostname: kafka-debug-ui
ports:
- "8080:8080"
networks:
- mojaloop-net
environment:
- KAFKA_BROKERS=kafka:29092
depends_on:
- kafka
profiles:
- debug