-
Notifications
You must be signed in to change notification settings - Fork 84
/
Copy pathdocker-compose.yml
249 lines (237 loc) · 7.26 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
version: "3.7"
networks:
cl-mojaloop-net:
name: cl-mojaloop-net
services:
central-ledger:
image: mojaloop/central-ledger:local
deploy:
replicas: 1
user: root
build:
context: .
cache_from:
- mojaloop/central-ledger
- central-ledger
container_name: cl_central-ledger
command:
- "sh"
- "-c"
- "sh /opt/wait-for/wait-for-central-ledger.sh && node src/api/index.js"
ports:
- "3001:3001"
volumes:
- ./docker/central-ledger/default.json:/opt/app/config/default.json
- ./docker/wait-for:/opt/wait-for
environment:
- LOG_LEVEL=info
- CSL_LOG_TRANSPORT=file
- CLEDG_MONGODB__DISABLED=false
networks:
- cl-mojaloop-net
depends_on:
- mysql
- kafka
- objstore
healthcheck:
test: ["CMD", "sh", "-c" ,"apk --no-cache add curl", "&&", "curl", "http://localhost:3001/health"]
timeout: 20s
retries: 10
interval: 30s
ml-api-adapter:
image: mojaloop/ml-api-adapter:latest
container_name: cl_ml-api-adapter
deploy:
replicas: 1
user: root
command:
- "sh"
- "-c"
- "sh /opt/wait-for/wait-for-ml-api-adapter.sh && node src/api/index.js"
ports:
- "3000:3000"
volumes:
- ./docker/ml-api-adapter/default.json:/opt/app/config/default.json
- ./docker/wait-for:/opt/wait-for
environment:
- LOG_LEVEL=info
networks:
- cl-mojaloop-net
depends_on:
- kafka
healthcheck:
test: ["CMD", "sh", "-c" ,"apk --no-cache add curl", "&&", "curl", "http://localhost:3000/health"]
timeout: 20s
retries: 10
interval: 30s
mysql:
image: mysql/mysql-server
container_name: cl_mysql
deploy:
replicas: 1
# Disable logging as it is far too verbose for debugging locally
logging:
driver: none
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:
- cl-mojaloop-net
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "mysql"]
timeout: 20s
retries: 10
start_period: 40s
interval: 30s
mockserver:
image: jamesdbloom/mockserver
container_name: mockserver
deploy:
replicas: 1
ports:
- "1080:1080"
networks:
- cl-mojaloop-net
temp_curl:
image: byrnedo/alpine-curl
container_name: cl_temp_curl
links:
- mockserver
volumes:
- ./docker/wait-for:/opt/wait-for
entrypoint: [ "sh", "-c" ]
command:
- /opt/wait-for/wait-for-mockserver.sh
environment: []
networks:
- cl-mojaloop-net
depends_on:
- mockserver
zookeeper:
image: confluentinc/cp-zookeeper:7.0.1
container_name: cl_zookeeper
# Disable logging as it is far too verbose for debugging locally
logging:
driver: none
ports:
- "2181:2181"
networks:
- cl-mojaloop-net
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
kafka:
image: confluentinc/cp-kafka:7.0.1
container_name: cl_kafka
# Disable logging as it is far too verbose for debugging locally
logging:
driver: none
ports:
# To learn about configuring Kafka for access across networks see
# https://www.confluent.io/blog/kafka-client-cannot-connect-to-broker-on-aws-on-docker-etc/
- "9092:9092"
networks:
- cl-mojaloop-net
depends_on:
- zookeeper
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
KAFKA_LISTENERS: LISTENER_DOCKER://kafka:29092,LISTENER_HOST://kafka:9092
KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER://kafka:29092,LISTENER_HOST://localhost:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER:PLAINTEXT,LISTENER_HOST:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
healthcheck:
test: ["CMD" ,"kafka-broker-api-versions","--bootstrap-server","kafka:29092"]
timeout: 20s
retries: 10
start_period: 40s
interval: 30s
init-kafka:
container_name: cl_init_kafka
networks:
- cl-mojaloop-net
image: docker.io/bitnami/kafka:3.2
depends_on:
- kafka
entrypoint: [ '/bin/sh', '-c' ]
command: |
"
# blocks until kafka is reachable
kafka-topics.sh --bootstrap-server kafka:29092 --list
echo -e 'Creating kafka topics'
kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-transfer-prepare --replication-factor 1 --partitions 1
kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-transfer-position --replication-factor 1 --partitions 1
kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-transfer-fulfil --replication-factor 1 --partitions 1
kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-notification-event --replication-factor 1 --partitions 1
kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-transfer-get --replication-factor 1 --partitions 1
kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-admin-transfer --replication-factor 1 --partitions 1
echo -e 'Successfully created the following topics:'
kafka-topics.sh --bootstrap-server kafka:29092 --list
"
objstore:
image: mongo:latest
container_name: cl_objstore
deploy:
replicas: 1
# Disable logging as it is far too verbose for debugging locally
logging:
driver: none
ports:
- "27017:27017"
networks:
- cl-mojaloop-net
healthcheck:
test: mongo --eval 'db.runCommand("ping").ok' localhost:27017/test --quiet
interval: 10s
timeout: 10s
retries: 5
start_period: 40s
simulator:
image: mojaloop/simulator:latest
container_name: cl_simulator
user: root
deploy:
replicas: 1
ports:
- "8444:8444"
environment:
- LOG_LEVEL=info
- TRANSFERS_ENDPOINT=http://host.docker.internal:3000
- QUOTES_ENDPOINT=http://host.docker.internal:3002
- PARTIES_ENDPOINT=http://host.docker.internal:4002
- TRANSFERS_FULFIL_RESPONSE_DISABLED=false
- TRANSFERS_CONDITION=HOr22-H3AfTDHrSkPjJtVPRdKouuMkDXTR4ejlQa8Ks
- TRANSFERS_FULFILMENT=XoSz1cL0tljJSCp_VtIYmPNw-zFUgGfbUqf69AagUzY
networks:
- cl-mojaloop-net
healthcheck:
test: ["CMD", "sh", "-c" ,"apk --no-cache add curl", ";", "curl", "http://localhost:8444/health"]
timeout: 20s
retries: 10
interval: 30s
kowl:
image: quay.io/cloudhut/kowl:v1.4.0
container_name: cl_kowl
deploy:
replicas: 1
restart: on-failure
hostname: kowl
ports:
- "8080:8080"
networks:
- cl-mojaloop-net
environment:
- KAFKA_BROKERS=kafka:29092
depends_on:
- kafka