kafka-zookeeper:
image: confluentinc/cp-zookeeper:7.3.0
container_name: zookeeper
restart: always
environment:
- ZOOKEEPER_CLIENT_PORT=12181
- ZOOKEEPER_TICK_TIME=2000
kafka-broker:
image: confluentinc/cp-kafka:7.3.0
container_name: broker
restart: always
ports:
- "29092:29092"
depends_on:
- kafka-zookeeper
environment:
- KAFKA_BROKER_ID=1
- KAFKA_ZOOKEEPER_CONNECT=zookeeper:12181
- KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=PLAINTEXT:PLAINTEXT
- KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://192.168.3.1:29092
- KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1