-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkafka-compose.yml
39 lines (35 loc) · 1.14 KB
/
kafka-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
version: '3.9'
services:
kafka:
container_name: kafka-sample
hostname: kafka-sample
image: bitnami/kafka:3.8.1
ports:
- '9092:9092'
- '9094:9094'
volumes:
- kafka_storage:/bitnami/kafka
environment:
- KAFKA_ENABLE_KRAFT=yes # use KRAFT instead of zookeeper for Quorum_lead
- KAFKA_CFG_PROCESS_ROLES=controller,broker
- KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,CONTROLLER://:9093,EXTERNAL://:9094
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,EXTERNAL:PLAINTEXT
- KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://127.0.0.1:9092,EXTERNAL://kafka-sample:9094
- KAFKA_CFG_NODE_ID=0
- [email protected]:9093
- KAFKA_AUTO_CREATE_TOPICS_ENABLE=true # Creating topic if the topic does not exist
- KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER
- ALLOW_PLAINTEXT_LISTENER=yes
networks:
- kafka-network
volumes:
kafka_storage:
driver: local
driver_opts:
type: 'none'
o: 'bind'
device: '${PWD}/docker-volume'
networks:
kafka-network:
name: kafka-network
driver: bridge