-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdocker-compose.yml
41 lines (40 loc) · 1.3 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
---
version: '3'
services:
zookeeper:
hostname: zookeeper
container_name: zookeeper
image: confluentinc/cp-zookeeper:latest
ports:
- "${ZK_PORT:-2181}"
environment:
ZOOKEEPER_CLIENT_PORT: ${ZK_PORT:-2181}
ZOOKEEPER_TICK_TIME: 2000
healthcheck:
test: ["CMD-SHELL", "echo ruok | nc -w 2 localhost ${ZK_PORT:-2181}"]
interval: 30s
timeout: 30s
retries: 5
broker:
image: confluentinc/cp-kafka:latest
hostname: broker
container_name: broker
ports:
- "${KAFKA_PORT:-9092}:${KAFKA_PORT:-9092}"
- "29092"
depends_on:
- zookeeper
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:${ZK_PORT:-2181}'
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: INTERNAL://broker:29092,EXTERNAL://localhost:${KAFKA_PORT:-9092}
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
CONFLUENT_METRICS_REPORTER_BOOTSTRAP_SERVERS: broker:29092
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
healthcheck:
test: ["CMD-SHELL", "echo healthcheck | kafka-console-producer --broker-list localhost:${KAFKA_PORT:-9092} --topic healthchecktopic"]
interval: 30s
timeout: 30s
retries: 5