-
Notifications
You must be signed in to change notification settings - Fork 27
/
docker-compose.yml
168 lines (158 loc) · 4.49 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
version: '3.7'
networks:
mojaloop-net:
name: mojaloop-net
services:
sdk-scheme-adapter-api-svc:
networks:
- mojaloop-net
image: mojaloop/sdk-scheme-adapter:local
container_name: sdk-scheme-adapter-api-svc
build:
context: ./
dockerfile: ./Dockerfile
env_file: ./modules/api-svc/test/config/integration.env
ports:
- "4000:4000"
- "4001:4001"
- "4002:4002"
- "9229:9229"
depends_on:
- redis
- ml-testing-toolkit
- kafka
command: yarn nx run modules-api-svc:start
volumes:
- ./docker/wait4:/tmp/wait4
- ./secrets:/opt/app/secrets
user: root # Set Root so we can install Curl for Healthchecks
healthcheck:
test: [
"CMD" ,
"apk", "add", "--no-cache", "curl", # Install curl
"&&",
"curl", "-f", "http://localhost:4001" # Check if api is up
]
timeout: 20s
retries: 10
start_period: 40s
interval: 30s
redis:
networks:
- mojaloop-net
image: "redis:6.2.4-alpine"
container_name: redis
ports:
- "6379:6379"
healthcheck:
test: ["CMD" ,"sh", "-c", "redis-cli","ping"]
timeout: 20s
retries: 10
start_period: 40s
interval: 30s
ml-testing-toolkit:
networks:
mojaloop-net:
aliases:
- ttkbackendsim
- ttkhubsim
image: mojaloop/ml-testing-toolkit:v15.0.0
volumes:
- "./docker/ml-testing-toolkit/spec_files:/opt/app/spec_files"
- "./docker/ml-testing-toolkit/secrets:/opt/app/secrets"
ports:
- "4040:4040"
- "5050:5050"
environment:
- AUTH_ENABLED=FALSE
command: npm start
# For local development we want to have ttk-ui
#
mojaloop-testing-toolkit-ui:
image: mojaloop/ml-testing-toolkit-ui:v15.0.0
ports:
- "6060:6060"
networks:
- mojaloop-net
environment:
- API_BASE_URL=http://localhost:5050
- AUTH_ENABLED=FALSE
command:
- sh
- /usr/share/nginx/start.sh
kafka:
networks:
- mojaloop-net
image: docker.io/bitnami/kafka:3.4.0
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://:29092,LISTENER_EXTERN://:9092
KAFKA_CFG_ADVERTISED_LISTENERS: LISTENER_DOCKER://kafka:29092,LISTENER_EXTERN://localhost: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
# For local development we want to have a redis-ui
#
redisinsight:
networks:
- mojaloop-net
image: redislabs/redisinsight
ports:
- "9001:8001"
volumes: []
restart: on-failure
profiles:
- debug
# For local development we want to have a kafka-ui
#
kowl:
networks:
- mojaloop-net
image: quay.io/cloudhut/kowl:v1.4.0
container_name: kowl
deploy:
replicas: 1
restart: on-failure
hostname: kowl
ports:
- "9080:8080"
environment:
- KAFKA_BROKERS=kafka:29092
depends_on:
- kafka
profiles:
- debug
init-kafka:
networks:
- mojaloop-net
image: docker.io/bitnami/kafka:3.4.0
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-sdk-outbound-command-events --replication-factor 1 --partitions 1
kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-sdk-outbound-domain-events --replication-factor 1 --partitions 1
echo -e 'Successfully created the following topics:'
kafka-topics.sh --bootstrap-server kafka:29092 --list
"