-
Notifications
You must be signed in to change notification settings - Fork 112
/
docker-compose.yml
343 lines (323 loc) 路 8.21 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
services:
redis:
hostname: redis
container_name: redis
image: redis:alpine
command: redis-server
ports:
- "6379:6379"
environment:
- REDIS_REPLICATION_MODE=master
healthcheck:
test: ["CMD", "redis-cli", "--raw", "incr", "ping"]
interval: 5s
timeout: 2s
retries: 20
networks:
- laudspeaker_default
postgres:
image: postgres:14.4-alpine
hostname: postgres
container_name: postgres
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password}
POSTGRES_DB: laudspeaker
ports:
- "5432:5432"
restart: unless-stopped
networks:
- laudspeaker_default
mongo:
image: "mongo:latest"
hostname: mongo
container_name: mongo
ports:
- "27017:27017"
command: "--bind_ip_all --replSet rs0"
healthcheck:
test:
[
"CMD",
"mongosh",
"admin",
"--port",
"27017",
"--eval",
"db.adminCommand('ping').ok",
]
interval: 5s
timeout: 2s
retries: 20
networks:
- laudspeaker_default
clickhouse:
hostname: clickhouse
container_name: clickhouse
image: clickhouse/clickhouse-server:latest
restart: on-failure
healthcheck:
test: wget --no-verbose --tries=1 --spider http://localhost:8123/ping || exit 1
interval: 5s
timeout: 2s
retries: 20
ports:
- "8123:8123"
- "9000:9000"
networks:
- laudspeaker_default
#### START kafka related containers
zoo1:
image: bitnami/zookeeper:latest
hostname: zoo1
container_name: zoo1
ports:
- "2181:2181"
environment:
ZOO_SERVERS: zoo1:2888:3888
ALLOW_ANONYMOUS_LOGIN: yes
networks:
- laudspeaker_default
kafka1:
image: bitnami/kafka:3.6.0
hostname: kafka1
container_name: kafka1
ports:
- "29092:29092"
- "9092:9092"
healthcheck:
test: kafka-cluster.sh cluster-id --bootstrap-server kafka1:19092 || exit 1
interval: 1s
timeout: 60s
retries: 60
environment:
KAFKA_CFG_LISTENERS: INTERNAL://kafka1:19092,EXTERNAL://kafka1:29092,DEV://kafka1:9092
KAFKA_CFG_ADVERTISED_LISTENERS: INTERNAL://kafka1:19092,EXTERNAL://host.docker.internal:29092,DEV://localhost:9092
KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT,DEV:PLAINTEXT
KAFKA_CFG_INTER_BROKER_LISTENER_NAME: INTERNAL
KAFKA_ZOOKEEPER_PROTOCOL: PLAINTEXT
KAFKA_CFG_ZOOKEEPER_CONNECT: "zoo1:2181"
KAFKA_TLS_CLIENT_AUTH: none
ALLOW_PLAINTEXT_LISTENER: "yes"
depends_on:
- zoo1
networks:
- laudspeaker_default
#### END kafka related containers
#### START kafka connect related containers
kafka-connect1:
image: bitnami/kafka:latest
hostname: kafka-connect1
container_name: kafka-connect1
healthcheck:
test: ["CMD", "curl", "localhost:8083"]
interval: 5s
timeout: 2s
retries: 20
ports:
- "8083:8083"
volumes:
- ./local-env/kafkaconnect:/opt/bitnami/kafka-connect
depends_on:
kafka1:
condition: service_healthy
networks:
- laudspeaker_default
command:
- bash
- -c
- /opt/bitnami/kafka/bin/connect-distributed.sh /opt/bitnami/kafka-connect/connect.properties
#### END kafka connect related containers
init-environment:
build:
context: ./local-env/
dockerfile: Dockerfile.initenv
container_name: init-environment
depends_on:
mongo:
condition: service_healthy
kafka1:
condition: service_started
clickhouse:
condition: service_healthy
kafka-connect1:
condition: service_healthy
s3:
condition: service_healthy
networks:
- laudspeaker_default
command:
- "environment"
s3:
image: quay.io/minio/minio
command: "server /data --console-address :9123"
ports:
- "9123:9123"
- "9001:9000"
healthcheck:
test: ["CMD", "mc", "ready", "local"]
interval: 5s
timeout: 5s
retries: 5
environment:
MINIO_ROOT_USER: test
MINIO_ROOT_PASSWORD: 12345678
container_name: s3
networks:
- laudspeaker_default
ping-server:
image: jaredhanson11/ping-server:latest
container_name: ping-server
ports:
- "8555:8555"
environment:
PORT: 8555
networks:
- laudspeaker_default
laudspeaker-web:
profiles:
- "testing"
image: ${LAUDSPEAKER_IMAGE:-laudspeaker/laudspeaker:latest}
container_name: laudspeaker-web
ports:
- "8080:8080"
healthcheck:
test: ["CMD", "curl", "-f", "localhost:8080"]
interval: 5s
timeout: 30s
retries: 20
start_period: 60s
depends_on:
init-environment:
condition: service_completed_successfully
s3-createbuckets:
condition: service_completed_successfully
env_file:
- ./local-env/env-docker-compose
networks:
- laudspeaker_default
laudspeaker-queue:
profiles:
- "testing"
image: ${LAUDSPEAKER_IMAGE:-laudspeaker/laudspeaker:latest}
container_name: laudspeaker-queue
command: "queue"
healthcheck:
test: '[ $(find /tmp/laudspeaker-healthcheck-queue -mmin -1 | wc -l) -eq 1 ] || false'
interval: 10s
timeout: 30s
retries: 10
depends_on:
laudspeaker-web:
condition: service_healthy
env_file:
- ./local-env/env-docker-compose
networks:
- laudspeaker_default
laudspeaker-cron:
profiles:
- "testing"
image: ${LAUDSPEAKER_IMAGE:-laudspeaker/laudspeaker:latest}
container_name: laudspeaker-cron
command: "cron"
healthcheck:
test: '[ $(find /tmp/laudspeaker-healthcheck-cron -mmin -1 | wc -l) -eq 1 ] || false'
interval: 10s
timeout: 30s
retries: 10
depends_on:
laudspeaker-web:
condition: service_healthy
env_file:
- ./local-env/env-docker-compose
networks:
- laudspeaker_default
s3-createbuckets:
image: minio/mc
profiles:
- "testing"
- gui
depends_on:
s3:
condition: service_healthy
entrypoint: >
/bin/sh -c "
/usr/bin/mc config host add s3 http://s3:9000 test 12345678;
/usr/bin/mc mb s3/$$AWS_S3_CUSTOMERS_IMPORT_BUCKET;
/usr/bin/mc mb s3/$$AWS_S3_BUCKET;
exit 0;
"
env_file:
- ./local-env/env-docker-compose
networks:
- laudspeaker_default
init-connectors:
build:
context: ./local-env/
dockerfile: Dockerfile.initenv
container_name: init-connectors
profiles:
- testing
depends_on:
laudspeaker-web:
condition: service_healthy
networks:
- laudspeaker_default
command:
- "connectors"
# GUIs for all supporting services.
# currently:
# - no gui setup for postgres
# - clickhouse gui is deployed with the clickhouse server
kafka-gui:
container_name: kafka-gui
image: provectuslabs/kafka-ui:latest
profiles:
- gui
ports:
- 8090:8080
depends_on:
kafka1:
condition: service_started
kafka-connect1:
condition: service_healthy
environment:
KAFKA_CLUSTERS_0_NAME: laudspeaker
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka1:29092
KAFKA_CLUSTERS_0_KAFKACONNECT_0_ADDRESS: http://kafka-connect1:8083
KAFKA_CLUSTERS_0_KAFKACONNECT_0_NAME: kafka-connect
DYNAMIC_CONFIG_ENABLED: "true"
networks:
- laudspeaker_default
redis-gui:
container_name: redis-gui
image: redis/redisinsight:latest
profiles:
- gui
ports:
- 8091:5540
depends_on:
redis:
condition: service_healthy
healthcheck:
test: wget --no-verbose --tries=1 --spider http://127.0.0.1:5540/api/health/ || exit 1
networks:
- laudspeaker_default
init-guis:
profiles:
- gui
build:
context: ./local-env/
dockerfile: Dockerfile.initenv
container_name: init-gui
depends_on:
redis-gui:
condition: service_healthy
networks:
- laudspeaker_default
command:
- "guis"
networks:
laudspeaker_default:
driver: bridge
name: laudspeaker_default