forked from kafkaex/kafka_ex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
104 lines (99 loc) · 2.37 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
version: '2.4'
services:
zookeeper:
image: wurstmeister/zookeeper:3.4.6
ports:
- "2181:2181"
healthcheck:
test: ["CMD-SHELL", "echo ruok | nc -w 2 127.0.0.1 2181 | grep -q imok"]
interval: 5s
timeout: 10s
retries: 15
start_period: 10s
kafka1:
hostname: kafka1
image: wurstmeister/kafka:0.11.0.1
ports:
- "9093:9093"
depends_on:
- zookeeper
volumes:
- ./ssl:/ssl
- ./scripts/kafka_check_health:/kafka_check_health
env_file: docker-compose-kafka.env
environment:
KAFKA_BROKER_ID: 1
KAFKA_ADVERTISED_PORT: 9093
KAFKA_PORT: 9092
KAFKA_HOST_NAME: kafka1
healthcheck:
test: /kafka_check_health
interval: 10s
timeout: 10s
retries: 30
start_period: 10s
depends_on:
zookeeper:
condition: service_healthy
kafka2:
hostname: kafka2
image: wurstmeister/kafka:0.11.0.1
ports:
- "9094:9094"
depends_on:
- zookeeper
volumes:
- ./ssl:/ssl
- ./scripts/kafka_check_health:/kafka_check_health
env_file: docker-compose-kafka.env
environment:
KAFKA_BROKER_ID: 2
KAFKA_ADVERTISED_PORT: 9094
KAFKA_PORT: 9092
KAFKA_HOST_NAME: kafka2
healthcheck:
test: /kafka_check_health
interval: 10s
timeout: 10s
retries: 30
start_period: 10s
depends_on:
zookeeper:
condition: service_healthy
kafka3:
hostname: kafka3
image: wurstmeister/kafka:0.11.0.1
ports:
- "9095:9095"
depends_on:
- zookeeper
volumes:
- ./ssl:/ssl
- ./scripts/kafka_check_health:/kafka_check_health
env_file: docker-compose-kafka.env
environment:
KAFKA_BROKER_ID: 3
KAFKA_ADVERTISED_PORT: 9095
KAFKA_PORT: 9092
KAFKA_HOST_NAME: kafka3
healthcheck:
test: /kafka_check_health
interval: 10s
timeout: 10s
retries: 30
start_period: 10s
depends_on:
zookeeper:
condition: service_healthy
# This is a dummy service that forces all other services to be healthy before
# docker-compose up can be considered successful.
ready:
image: busybox:1.31-musl
command: tail -f /dev/null
depends_on:
kafka1:
condition: service_healthy
kafka2:
condition: service_healthy
kafka3:
condition: service_healthy