@@ -222,35 +222,28 @@ services:
222222
223223 {%- if cookiecutter.enable_kafka == "True" %}
224224
225- zookeeper :
226- image : " bitnami/zookeeper:3.7.1"
227- hostname : " {{cookiecutter.project_name}}-zookeeper"
228- environment :
229- ALLOW_ANONYMOUS_LOGIN : " yes"
230- ZOO_LOG_LEVEL : " ERROR"
231- healthcheck :
232- test : zkServer.sh status
233- interval : 1s
234- timeout : 3s
235- retries : 30
236-
237225 kafka :
238- image : " bitnami/kafka:3.2.0 "
226+ image : bitnami/kafka:3.7.1-debian-12-r0
239227 hostname : " {{cookiecutter.project_name}}-kafka"
240228 environment :
241- KAFKA_BROKER_ID : " 1"
242- ALLOW_PLAINTEXT_LISTENER : " yes"
243- KAFKA_CFG_LISTENERS : " PLAINTEXT://0.0.0.0:9092"
244- KAFKA_CFG_ADVERTISED_LISTENERS : " PLAINTEXT://{{cookiecutter.project_name}}-kafka:9092"
245- KAFKA_CFG_ZOOKEEPER_CONNECT : " {{cookiecutter.project_name}}-zookeeper:2181"
229+ KAFKA_CFG_NODE_ID : " 0"
230+ KAFKA_CFG_PROCESS_ROLES : " controller,broker"
231+ KAFKA_CFG_LISTENERS : " PLAINTEXT://:9092,CONTROLLER://:9093,EXTERNAL://:9094"
232+ KAFKA_CFG_ADVERTISED_LISTENERS : " PLAINTEXT://kafka:9092,EXTERNAL://localhost:9094"
233+ KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP : " CONTROLLER:PLAINTEXT,EXTERNAL:PLAINTEXT,PLAINTEXT:PLAINTEXT"
234+ KAFKA_CFG_CONTROLLER_QUORUM_VOTERS : " 0@{{cookiecutter.project_name}}-kafka:9093"
235+ KAFKA_CFG_CONTROLLER_LISTENER_NAMES : " CONTROLLER"
236+ KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE : " true"
237+ KAFKA_CFG_OFFSETS_TOPIC_REPLICATION_FACTOR : " 1"
238+ # Uncomment it to connect from localhost.
239+ # ports:
240+ # - 9094:9094
246241 healthcheck :
247242 test : kafka-topics.sh --list --bootstrap-server localhost:9092
248243 interval : 1s
249244 timeout : 3s
250245 retries : 30
251- depends_on :
252- zookeeper :
253- condition : service_healthy
246+
254247 {%- endif %}
255248
256249{% if cookiecutter.db_info.name != 'none' %}
0 commit comments