-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
393 lines (375 loc) · 8.47 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
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
version: "3"
networks:
consumer-network:
kafka-cluster:
name: kafka-cluster
driver: bridge
services:
zookeeper:
image: bitnami/zookeeper:3.6.2
container_name: zookeeper
deploy:
resources:
limits:
cpus: '0.50'
memory: 512M
reservations:
cpus: '0.25'
memory: 128M
ports:
- '2181:2181'
environment:
- ALLOW_ANONYMOUS_LOGIN=yes
networks:
- kafka-cluster
kafka1:
image: bitnami/kafka:2.7.0
container_name: kafka1
deploy:
resources:
limits:
cpus: '0.50'
memory: 512M
reservations:
cpus: '0.25'
memory: 128M
ports:
- '9093:9093'
environment:
- KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
- ALLOW_PLAINTEXT_LISTENER=yes
- KAFKA_ZOOKEEPER_CONNECTION_TIMEOUT_MS= 36000
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CLIENT:PLAINTEXT,EXTERNAL:PLAINTEXT
- KAFKA_CFG_LISTENERS=CLIENT://:9092,EXTERNAL://:9093
- KAFKA_CFG_ADVERTISED_LISTENERS=CLIENT://kafka1:9092,EXTERNAL://localhost:9093
- KAFKA_INTER_BROKER_LISTENER_NAME=CLIENT
- KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE=true
# - KAFKA_CREATE_TOPICS= "india:1:1,egypt:1:1,singapore:1:1"
depends_on:
- zookeeper
networks:
- kafka-cluster
kafka2:
image: bitnami/kafka:2.7.0
container_name: kafka2
deploy:
resources:
limits:
cpus: '0.50'
memory: 512M
reservations:
cpus: '0.25'
memory: 128M
ports:
- '9094:9094'
environment:
- KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
- ALLOW_PLAINTEXT_LISTENER=yes
- KAFKA_ZOOKEEPER_CONNECTION_TIMEOUT_MS= 36000
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CLIENT:PLAINTEXT,EXTERNAL:PLAINTEXT
- KAFKA_CFG_LISTENERS=CLIENT://:9092,EXTERNAL://:9094
- KAFKA_CFG_ADVERTISED_LISTENERS=CLIENT://kafka2:9092,EXTERNAL://localhost:9094
- KAFKA_INTER_BROKER_LISTENER_NAME=CLIENT
- KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE=true
# - KAFKA_CREATE_TOPICS= "india:1:1,egypt:1:1,singapore:1:1"
depends_on:
- zookeeper
networks:
- kafka-cluster
kafka3:
image: bitnami/kafka:2.7.0
container_name: kafka3
deploy:
resources:
limits:
cpus: '0.50'
memory: 512M
reservations:
cpus: '0.25'
memory: 128M
ports:
- '9095:9095'
environment:
- KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
- ALLOW_PLAINTEXT_LISTENER=yes
- KAFKA_ZOOKEEPER_CONNECTION_TIMEOUT_MS= 36000
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CLIENT:PLAINTEXT,EXTERNAL:PLAINTEXT
- KAFKA_CFG_LISTENERS=CLIENT://:9092,EXTERNAL://:9095
- KAFKA_CFG_ADVERTISED_LISTENERS=CLIENT://kafka3:9092,EXTERNAL://localhost:9095
- KAFKA_INTER_BROKER_LISTENER_NAME=CLIENT
- KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE=true
# - KAFKA_CREATE_TOPICS= "india:1:1,egypt:1:1,singapore:1:1"
depends_on:
- zookeeper
networks:
- kafka-cluster
producer-india:
image: india.jar
build:
context: ./
dockerfile: DockerfileIndia
container_name: producer-india
deploy:
resources:
limits:
cpus: '0.50'
memory: 512M
reservations:
cpus: '0.25'
memory: 128M
environment:
- SERVER_PORT = 8050
ports:
- "8050:8050"
networks:
- kafka-cluster
producer-egypt:
image: egypt.jar
build:
context: ./
dockerfile: DockerfileEgypt
container_name: producer-egypt
deploy:
resources:
limits:
cpus: '0.50'
memory: 512M
reservations:
cpus: '0.25'
memory: 128M
environment:
- SERVER_PORT = 8060
ports:
- "8060:8060"
networks:
- kafka-cluster
producer-singapore:
image: singapore.jar
build:
context: ./
dockerfile: DockerfileSingapore
container_name: producer-singapore
deploy:
resources:
limits:
cpus: '0.50'
memory: 512M
reservations:
cpus: '0.25'
memory: 128M
environment:
- SERVER_PORT = 8070
ports:
- "8070:8070"
networks:
- kafka-cluster
consumer-1:
image: consumer1.jar
build:
context: ./
dockerfile: Dockerfile1
container_name: consumer-1
deploy:
resources:
limits:
cpus: '0.50'
memory: 512M
reservations:
cpus: '0.25'
memory: 128M
environment:
- SERVER_PORT = 8080
- CONSUMER_GROUP = group_1
ports:
- "8080:8080"
networks:
- kafka-cluster
consumer-2:
image: consumer2.jar
build:
context: ./
dockerfile: Dockerfile2
container_name: consumer-2
deploy:
resources:
limits:
cpus: '0.50'
memory: 512M
reservations:
cpus: '0.25'
memory: 128M
environment:
- SERVER_PORT = 8081
- CONSUMER_GROUP = group_2
ports:
- "8081:8081"
networks:
- kafka-cluster
consumer-3:
image: consumer3.jar
build:
context: ./
dockerfile: Dockerfile3
container_name: consumer-3
deploy:
resources:
limits:
cpus: '0.50'
memory: 512M
reservations:
cpus: '0.25'
memory: 128M
environment:
- SERVER_PORT = 8082
- CONSUMER_GROUP = group_3
ports:
- "8082:8082"
networks:
- kafka-cluster
consumer-4:
image: consumer4.jar
build:
context: ./
dockerfile: Dockerfile4
container_name: consumer-4
deploy:
resources:
limits:
cpus: '0.50'
memory: 512M
reservations:
cpus: '0.25'
memory: 128M
environment:
- SERVER_PORT = 8083
- CONSUMER_GROUP = group_4
ports:
- "8083:8083"
networks:
- kafka-cluster
consumer-5:
image: consumer5.jar
build:
context: ./
dockerfile: Dockerfile5
container_name: consumer-5
deploy:
resources:
limits:
cpus: '0.50'
memory: 512M
reservations:
cpus: '0.25'
memory: 128M
environment:
- SERVER_PORT = 8084
- CONSUMER_GROUP = group_5
ports:
- "8084:8084"
networks:
- kafka-cluster
consumer-6:
image: consumer6.jar
build:
context: ./
dockerfile: Dockerfile6
container_name: consumer-6
deploy:
resources:
limits:
cpus: '0.50'
memory: 512M
reservations:
cpus: '0.25'
memory: 128M
environment:
- SERVER_PORT = 8085
- CONSUMER_GROUP = group_6
ports:
- "8085:8085"
networks:
- kafka-cluster
consumer-7:
image: consumer7.jar
build:
context: ./
dockerfile: Dockerfile7
container_name: consumer-7
deploy:
resources:
limits:
cpus: '0.50'
memory: 512M
reservations:
cpus: '0.25'
memory: 128M
environment:
- SERVER_PORT = 8086
- CONSUMER_GROUP = group_7
ports:
- "8086:8086"
networks:
- kafka-cluster
consumer-8:
image: consumer8.jar
build:
context: ./
dockerfile: Dockerfile8
container_name: consumer-8
deploy:
resources:
limits:
cpus: '0.50'
memory: 512M
reservations:
cpus: '0.25'
memory: 128M
environment:
- SERVER_PORT = 8087
- CONSUMER_GROUP = group_8
ports:
- "8087:8087"
networks:
- kafka-cluster
consumer-9:
image: consumer9.jar
build:
context: ./
dockerfile: Dockerfile9
container_name: consumer-9
deploy:
resources:
limits:
cpus: '0.50'
memory: 512M
reservations:
cpus: '0.25'
memory: 128M
environment:
- SERVER_PORT = 8088
- CONSUMER_GROUP = group_9
ports:
- "8088:8088"
networks:
- kafka-cluster
consumer-10:
image: consumer10.jar
build:
context: ./
dockerfile: Dockerfile10
container_name: consumer-10
deploy:
resources:
limits:
cpus: '0.50'
memory: 512M
reservations:
cpus: '0.25'
memory: 128M
environment:
- SERVER_PORT = 8089
- CONSUMER_GROUP = group_10
ports:
- "8089:8089"
networks:
- kafka-cluster