From f0d3d8c2e2c8836caa3241b1fb2c15a50e6865b2 Mon Sep 17 00:00:00 2001 From: Maciej Mensfeld Date: Fri, 22 Sep 2023 10:36:46 +0200 Subject: [PATCH] beter docker --- docker-compose.yml | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 23b1d880..bb25a146 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,18 +1,24 @@ version: '2' + services: zookeeper: - image: wurstmeister/zookeeper - ports: - - "2181:2181" + container_name: waterdrop_zookeeper + image: confluentinc/cp-zookeeper:7.5.0 + environment: + ZOOKEEPER_CLIENT_PORT: 2181 + ZOOKEEPER_TICK_TIME: 100 + kafka: - image: wurstmeister/kafka:2.12-2.5.0 + container_name: waterdrop_zookeeper + image: confluentinc/cp-kafka:7.5.0 + depends_on: + - zookeeper ports: - - "9092:9092" + - 9092:9092 environment: - KAFKA_ADVERTISED_HOST_NAME: localhost - KAFKA_ADVERTISED_PORT: 9092 + KAFKA_BROKER_ID: 1 KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 - KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true' - KAFKA_CREATE_TOPICS: 'example_topic:1:1' - volumes: - - /var/run/docker.sock:/var/run/docker.sock + KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:29092,PLAINTEXT_HOST://localhost:9092 + KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT + KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT + KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1