-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
73 lines (68 loc) · 1.97 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
version: '3'
services:
app:
build:
context: .
dockerfile: ./docker/app/Dockerfile
hostname: app
ports:
- 80:80
volumes:
- .:/app
tty: true
depends_on:
- kafka1
- kafka2
zookeeper1:
image: wurstmeister/zookeeper
hostname: zookeeper1
ports:
- 2181:2181
environment:
ZOO_MY_ID: 1
ZOO_PORT: 2181
zookeeper2:
image: wurstmeister/zookeeper
hostname: zookeeper2
ports:
- 2182:2182
environment:
ZOO_MY_ID: 2
ZOO_PORT: 2182
kafka1:
image: wurstmeister/kafka
hostname: kafka1 # kafka-logs-{hostname}
ports:
- 9092:9092
environment:
KAFKA_BROKER_ID: 1
KAFKA_LISTENERS: LISTENER_DOCKER_INTERNAL://kafka1:19092,LISTENER_DOCKER_EXTERNAL://kafka1:9092
KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER_INTERNAL://kafka1:19092,LISTENER_DOCKER_EXTERNAL://localhost:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER_INTERNAL:PLAINTEXT,LISTENER_DOCKER_EXTERNAL:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL
KAFKA_ZOOKEEPER_CONNECT: zookeeper1:2181,zookeeper2:2182
volumes:
- kafka1-data:/kafka
depends_on:
- zookeeper1
- zookeeper2
kafka2:
image: wurstmeister/kafka
hostname: kafka2 # kafka-logs-{hostname}
ports:
- 9093:9093
environment:
KAFKA_BROKER_ID: 2
KAFKA_LISTENERS: LISTENER_DOCKER_INTERNAL://kafka2:19093,LISTENER_DOCKER_EXTERNAL://kafka2:9093
KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER_INTERNAL://kafka2:19093,LISTENER_DOCKER_EXTERNAL://localhost:9093
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER_INTERNAL:PLAINTEXT,LISTENER_DOCKER_EXTERNAL:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL
KAFKA_ZOOKEEPER_CONNECT: zookeeper1:2181,zookeeper2:2182
volumes:
- kafka2-data:/kafka
depends_on:
- zookeeper1
- zookeeper2
volumes:
kafka1-data:
kafka2-data: