-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathdocker-compose.yml
243 lines (232 loc) · 6.16 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
networks:
als-mojaloop-net:
name: als-mojaloop-net
# @see https://uninterrupted.tech/blog/hassle-free-redis-cluster-deployment-using-docker/
x-redis-node: &REDIS_NODE
image: docker.io/bitnami/redis-cluster:6.2.14
environment: &REDIS_ENVS
ALLOW_EMPTY_PASSWORD: yes
REDIS_CLUSTER_DYNAMIC_IPS: no
REDIS_CLUSTER_ANNOUNCE_IP: ${REDIS_CLUSTER_ANNOUNCE_IP}
REDIS_NODES: localhost:6379 localhost:6380 localhost:6381 localhost:6382 localhost:6383 localhost:6384
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
timeout: 2s
network_mode: host
x-account-lookup-service: &ACCOUNT_LOOKUP_SERVICE
image: mojaloop/account-lookup-service:local
build:
context: .
target: builder
user: root
environment:
LOG_LEVEL: debug
networks:
- als-mojaloop-net
depends_on:
- central-ledger
- proxy
- mysql-als
- redis-node-0
# - redis
volumes:
- ./secrets:/opt/app/secrets
- ./src:/opt/app/src
- ./docker/account-lookup-service/default.json:/opt/app/config/default.json
- ./docker/wait-for:/opt/wait-for
extra_hosts:
- "redis-node-0:host-gateway"
services:
account-lookup-service:
<<: *ACCOUNT_LOOKUP_SERVICE
container_name: als_account-lookup-service
command:
- "sh"
- "-c"
- "sh /opt/wait-for/wait-for-account-lookup-service.sh && node src/index.js server"
ports:
- "4001:4001"
- "4002:4002"
healthcheck:
test: ["CMD", "sh", "-c" ,"apk --no-cache add curl", ";", "curl", "http://localhost:4001/health"]
timeout: 20s
retries: 10
interval: 30s
account-lookup-service-handlers:
<<: *ACCOUNT_LOOKUP_SERVICE
container_name: als_account-lookup-service-handlers
command:
- "sh"
- "-c"
- "node src/handlers/index.js h --timeout"
depends_on:
- redis-node-0
ports:
- "4003:4003"
healthcheck:
test: ["CMD", "sh", "-c" ,"apk --no-cache add curl", ";", "curl", "http://localhost:4003/health"]
timeout: 20s
retries: 10
interval: 30s
central-ledger:
# image: mojaloop/central-ledger:latest
image: mojaloop/central-ledger:v17.8.0-snapshot.34
container_name: als_central-ledger
user: root
command:
- "sh"
- "-c"
- "sh /opt/wait-for/wait-for-central-ledger.sh && node src/api/index.js"
ports:
- "${CL_PORT:-3001}:3001"
volumes:
- ./docker/central-ledger/default.json:/opt/app/config/default.json
- ./docker/wait-for:/opt/wait-for
environment:
- LOG_LEVEL=debug
- CLEDG_DATABASE_URI=mysql://central_ledger:password@mysql-cl:3306/central_ledger
- CLEDG_SIDECAR__DISABLED=true
- CLEDG_MONGODB__DISABLED=true
networks:
- als-mojaloop-net
depends_on:
- mysql-cl
- kafka
- redis-node-0
extra_hosts:
- "redis-node-0:host-gateway"
healthcheck:
test: ["CMD", "sh", "-c" ,"apk --no-cache add curl", ";", "curl", "http://localhost:3001/health"]
timeout: 20s
retries: 10
interval: 30s
proxy:
build:
context: ./docker/mock-proxy
dockerfile: Dockerfile
restart: always
env_file: ./test/integration/.env
ports:
- "${PROXY_PORT}:${PROXY_PORT}"
networks:
- als-mojaloop-net
kafka:
image: johnnypark/kafka-zookeeper:2.3.0
container_name: als_kafka
volumes:
- ./docker/kafka/:/opt/kafka_2.12-2.3.0/config/
ports:
- "2181:2181"
- "9092:9092"
environment:
- ZOO_LOG4J_PROP=WARN
networks:
- als-mojaloop-net
healthcheck:
test: ["CMD", "/opt/kafka_2.12-2.3.0/bin/kafka-broker-api-versions.sh", "--bootstrap-server", "kafka:29092"]
timeout: 20s
retries: 10
start_period: 40s
interval: 30s
mysql-als:
image: mysql/mysql-server
container_name: als_mysql
ports:
- "3306:3306"
volumes:
- ./docker/sql-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:
- als-mojaloop-net
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "mysql-als"]
timeout: 20s
retries: 10
start_period: 40s
interval: 30s
mysql-cl:
image: mysql/mysql-server
container_name: als_mysql_central_ledger
ports:
- "3307:3306"
volumes:
- ./docker/sql-init-central-ledger/:/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:
- als-mojaloop-net
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "mysql-cl"]
timeout: 20s
retries: 10
start_period: 40s
interval: 30s
redis-node-0:
<<: *REDIS_NODE
environment:
<<: *REDIS_ENVS
REDIS_CLUSTER_CREATOR: yes
REDIS_PORT_NUMBER: 6379
depends_on:
- redis-node-1
- redis-node-2
- redis-node-3
- redis-node-4
- redis-node-5
redis-node-1:
<<: *REDIS_NODE
environment:
<<: *REDIS_ENVS
REDIS_PORT_NUMBER: 6380
ports:
- "16380:16380"
redis-node-2:
<<: *REDIS_NODE
environment:
<<: *REDIS_ENVS
REDIS_PORT_NUMBER: 6381
ports:
- "16381:16381"
redis-node-3:
<<: *REDIS_NODE
environment:
<<: *REDIS_ENVS
REDIS_PORT_NUMBER: 6382
ports:
- "16382:16382"
redis-node-4:
<<: *REDIS_NODE
environment:
<<: *REDIS_ENVS
REDIS_PORT_NUMBER: 6383
ports:
- "16383:16383"
redis-node-5:
<<: *REDIS_NODE
environment:
<<: *REDIS_ENVS
REDIS_PORT_NUMBER: 6384
ports:
- "16384:16384"
## To be used with proxyCache.type === 'redis'
# redis:
# image: redis:6.2.4-alpine
# restart: "unless-stopped"
# environment:
# <<: *REDIS_ENVS
# REDIS_CLUSTER_CREATOR: yes
# depends_on:
# - redis-node-1
# - redis-node-2
# - redis-node-3
# - redis-node-4
# - redis-node-5
# ports:
# - "6379:6379"