-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
33 lines (32 loc) · 1.07 KB
/
docker-compose.yaml
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
services:
zookeeper:
image: zookeeper:3.7.2
ports:
- "2181:2181"
kafka:
image: wurstmeister/kafka:2.13-2.8.1
ports:
- "9092:9092" # OUTSIDE listener
- "9093:9093" # INSIDE listener
environment:
KAFKA_ADVERTISED_LISTENERS: INSIDE://kafka:9093,OUTSIDE://localhost:9092
KAFKA_LISTENERS: INSIDE://0.0.0.0:9093,OUTSIDE://0.0.0.0:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: INSIDE
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
depends_on:
- zookeeper
command:
- /bin/sh
- -c
- |
# Wait for Zookeeper to be ready
while ! nc -z zookeeper 2181; do sleep 1; done;
# Start Kafka server
start-kafka.sh &
# Wait for Kafka to be ready
sleep 10;
# Create topics
# kafka-topics.sh --create --topic 342498f2-87b3-4e64-9325-eb70471623de --partitions 1 --replication-factor 1 --if-not-exists --bootstrap-server kafka:9093;
# Keep the container running
tail -f /dev/null