Volumes für die Log-/Config-Daten und Zookeeper hinzugefügt
authorKai Moritz <kai@juplo.de>
Mon, 16 Oct 2023 19:13:52 +0000 (21:13 +0200)
committerKai Moritz <kai@juplo.de>
Mon, 16 Oct 2023 19:43:18 +0000 (21:43 +0200)
docker/docker-compose.yml

index ead6274..007f923 100644 (file)
@@ -6,6 +6,9 @@ services:
       ZOOKEEPER_CLIENT_PORT: 2181
     ports:
       - 2181:2181
+    volumes:
+      - zookeeper-data:/var/lib/zookeeper/data
+      - zookeeper-log:/var/lib/zookeeper/log
 
   kafka-1:
     image: confluentinc/cp-kafka:7.5.1
@@ -18,6 +21,8 @@ services:
       KAFKA_INTER_BROKER_LISTENER_NAME: BROKER
       KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 3
       KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false"
+    volumes:
+      - kafka-1-data:/var/lib/kafka/data
     ports:
       - 9081:9081
     depends_on:
@@ -34,6 +39,8 @@ services:
       KAFKA_INTER_BROKER_LISTENER_NAME: BROKER
       KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 3
       KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false"
+    volumes:
+      - kafka-2-data:/var/lib/kafka/data
     ports:
       - 9092:9082
       - 9082:9082
@@ -55,6 +62,8 @@ services:
       KAFKA_INTER_BROKER_LISTENER_NAME: BROKER
       KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 3
       KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false"
+    volumes:
+      - kafka-3-data:/var/lib/kafka/data
     ports:
       - 9083:9083
     depends_on:
@@ -97,3 +106,10 @@ services:
     command: sleep infinity
     depends_on:
       - setup
+
+volumes:
+  zookeeper-data:
+  zookeeper-log:
+  kafka-1-data:
+  kafka-2-data:
+  kafka-3-data: