-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
297 lines (284 loc) · 8.91 KB
/
docker-compose.yml
File metadata and controls
297 lines (284 loc) · 8.91 KB
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
version: "3.8"
networks:
wtc_cap_one:
driver: bridge
volumes:
redpanda-0: null
redpanda-1: null
redpanda-2: null
services:
# Infrastructure services
postgres:
build: ./pgsql
container_name: postgres
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres"]
interval: 10s # Time between running the check
timeout: 60s # Time after which the check is considered failed if no response
retries: 50 # How many times to retry before marking the service as unhealthy
start_period: 10s # Start period before the first check is run
volumes:
- ./volumes/data/postgres/var/lib/postgresql/data:/var/lib/postgresql/data
- ./volumes/config/postgres/var/lib/postgresql/data/postgresql.conf:/etc/postgresql/postgresql.conf
networks:
- wtc_cap_one
ports:
- "15432:5432"
command: ["postgres", "-c", "config_file=/etc/postgresql/postgresql.conf"]
deploy:
restart_policy:
condition: on-failure
delay: 5s
window: 60s
resources:
limits:
cpus: "2.0"
memory: "1g"
reservations:
cpus: "2"
memory: "512m"
sftp:
image: "emberstack/sftp"
container_name: sftp
networks:
- wtc_cap_one
ports:
- "10022:22"
volumes:
- ./volumes/data/sftp/home/cdr_data:/home/cdr_data
- ./volumes/config/sftp/config.json:/app/config/sftp.json:ro
deploy:
resources:
limits:
cpus: "1"
memory: "128m"
reservations:
cpus: "0.5"
memory: "128m"
redpanda-0:
command:
- redpanda
- start
- --kafka-addr internal://0.0.0.0:9092,external://0.0.0.0:19092
# Address the broker advertises to clients that connect to the Kafka API.
# Use the internal addresses to connect to the Redpanda brokers'
# from inside the same Docker network.
# Use the external addresses to connect to the Redpanda brokers'
# from outside the Docker network.
- --advertise-kafka-addr internal://redpanda-0:9092,external://localhost:19092
- --pandaproxy-addr internal://0.0.0.0:8082,external://0.0.0.0:18082
# Address the broker advertises to clients that connect to the HTTP Proxy.
- --advertise-pandaproxy-addr internal://redpanda-0:8082,external://localhost:18082
- --schema-registry-addr internal://0.0.0.0:8081,external://0.0.0.0:18081
# Redpanda brokers use the RPC API to communicate with each other internally.
- --rpc-addr redpanda-0:33145
- --advertise-rpc-addr redpanda-0:33145
# Mode dev-container uses well-known configuration properties for development in containers.
- --mode dev-container
# Tells Seastar (the framework Redpanda uses under the hood) to use 1 core on the system.
- --smp 1
- --default-log-level=info
image: docker.redpanda.com/redpandadata/redpanda:v24.2.7
container_name: redpanda-0
volumes:
- ./volumes/data/redpanda/redpanda-0:/var/lib/redpanda/data
- ./volumes/config/redpanda/redpanda-0/etc/redpanda:/etc/redpanda
networks:
- wtc_cap_one
ports:
- 18081:18081
- 18082:18082
- 19092:19092
- 19644:9644
healthcheck:
test:
["CMD-SHELL", "rpk cluster health | grep -E 'Healthy:.+true' || exit 1"]
interval: 10s # Time between running the check
timeout: 60s # Time after which the check is considered failed if no response
retries: 50 # How many times to retry before marking the service as unhealthy
start_period: 10s
redpanda-1:
command:
- redpanda
- start
- --kafka-addr internal://0.0.0.0:9092,external://0.0.0.0:29092
- --advertise-kafka-addr internal://redpanda-1:9092,external://localhost:29092
- --pandaproxy-addr internal://0.0.0.0:8082,external://0.0.0.0:28082
- --advertise-pandaproxy-addr internal://redpanda-1:8082,external://localhost:28082
- --schema-registry-addr internal://0.0.0.0:8081,external://0.0.0.0:28081
- --rpc-addr redpanda-1:33145
- --advertise-rpc-addr redpanda-1:33145
- --mode dev-container
- --smp 1
- --default-log-level=info
- --seeds redpanda-0:33145
image: docker.redpanda.com/redpandadata/redpanda:v24.2.7
container_name: redpanda-1
volumes:
- ./volumes/data/redpanda/redpanda-1:/var/lib/redpanda/data
- ./volumes/config/redpanda/redpanda-1/etc/redpanda:/etc/redpanda
networks:
- wtc_cap_one
ports:
- 28081:28081
- 28082:28082
- 29092:29092
- 29644:9644
healthcheck:
test:
["CMD-SHELL", "rpk cluster health | grep -E 'Healthy:.+true' || exit 1"]
interval: 10s # Time between running the check
timeout: 60s # Time after which the check is considered failed if no response
retries: 50 # How many times to retry before marking the service as unhealthy
start_period: 10s
depends_on:
- redpanda-0
redpanda-2:
command:
- redpanda
- start
- --kafka-addr internal://0.0.0.0:9092,external://0.0.0.0:39092
- --advertise-kafka-addr internal://redpanda-2:9092,external://localhost:39092
- --pandaproxy-addr internal://0.0.0.0:8082,external://0.0.0.0:38082
- --advertise-pandaproxy-addr internal://redpanda-2:8082,external://localhost:38082
- --schema-registry-addr internal://0.0.0.0:8081,external://0.0.0.0:38081
- --rpc-addr redpanda-2:33145
- --advertise-rpc-addr redpanda-2:33145
- --mode dev-container
- --smp 1
- --default-log-level=info
- --seeds redpanda-0:33145
image: docker.redpanda.com/redpandadata/redpanda:v24.2.7
container_name: redpanda-2
volumes:
- ./volumes/data/redpanda/redpanda-2:/var/lib/redpanda/data
- ./volumes/config/redpanda/redpanda-2/etc/redpanda:/etc/redpanda
networks:
- wtc_cap_one
ports:
- 38081:38081
- 38082:38082
- 39092:39092
- 39644:9644
healthcheck:
test:
["CMD-SHELL", "rpk cluster health | grep -E 'Healthy:.+true' || exit 1"]
interval: 10s # Time between running the check
timeout: 60s # Time after which the check is considered failed if no response
retries: 50 # How many times to retry before marking the service as unhealthy
start_period: 10s
depends_on:
- redpanda-0
console:
container_name: redpanda-console
image: docker.redpanda.com/redpandadata/console:v2.7.2
networks:
- wtc_cap_one
entrypoint: /bin/sh
command: -c 'echo "$$CONSOLE_CONFIG_FILE" > /tmp/config.yml; /app/console'
environment:
CONFIG_FILEPATH: /tmp/config.yml
CONSOLE_CONFIG_FILE: |
kafka:
brokers: ["redpanda-0:9092"]
schemaRegistry:
enabled: true
urls: ["http://redpanda-0:8081"]
redpanda:
adminApi:
enabled: true
urls: ["http://redpanda-0:9644"]
ports:
- 18084:8080
depends_on:
- redpanda-0
# Data generators
forex:
build: ./forex
container_name: forex
networks:
- wtc_cap_one
depends_on:
redpanda-0:
condition: service_healthy
redpanda-1:
condition: service_healthy
redpanda-2:
condition: service_healthy
deploy:
resources:
limits:
cpus: "0.5"
memory: "128m"
reservations:
cpus: "0.25"
memory: "64m"
# Python App - CDR
cdr:
build: ./cdr
container_name: cdr
networks:
- wtc_cap_one
depends_on:
postgres:
condition: service_healthy
deploy:
resources:
limits:
cpus: "1"
memory: "128m"
reservations:
cpus: "0.5"
memory: "64m"
# Python App - CDR
crm:
build: ./crm
container_name: crm
networks:
- wtc_cap_one
depends_on:
postgres:
condition: service_healthy
deploy:
resources:
limits:
cpus: "0.5"
memory: "128m"
reservations:
cpus: "0.25"
memory: "64m"
#############################
# Add you containers etc here
#############################
debezium:
container_name: debezium_connect
image: debezium/connect:2.7.3.Final
networks:
- wtc_cap_one
depends_on:
- redpanda-0
- redpanda-1
- redpanda-2
- postgres
ports:
- "8083:8083"
environment:
BOOTSTRAP_SERVERS: "redpanda-0:9092,redpanda-1:9092,redpanda-2:9092"
GROUP_ID: "1"
CONFIG_STORAGE_TOPIC: "wtc_prod.configs"
OFFSET_STORAGE_TOPIC: "wtc_prod.offset"
STATUS_STORAGE_TOPIC: "wtc_prod.status"
persist:
build: ./redpanda_to_postgres
container_name: persist-postgres
networks:
- wtc_cap_one
depends_on:
redpanda-0:
condition: service_healthy
redpanda-1:
condition: service_healthy
redpanda-2:
condition: service_healthy
postgres:
condition: service_healthy