Setup an aktuellen Stand der Vorgänger angepasst spring/endless-stream-producer
authorKai Moritz <kai@juplo.de>
Wed, 25 Sep 2024 16:33:44 +0000 (18:33 +0200)
committerKai Moritz <kai@juplo.de>
Wed, 25 Sep 2024 17:04:00 +0000 (19:04 +0200)
README.sh
docker-compose.yml [deleted file]
docker/docker-compose.yml [new file with mode: 0644]

index 93a5eda..627ebb1 100755 (executable)
--- a/README.sh
+++ b/README.sh
@@ -4,12 +4,12 @@ IMAGE=juplo/spring-endless-stream-producer:1.0-SNAPSHOT
 
 if [ "$1" = "cleanup" ]
 then
 
 if [ "$1" = "cleanup" ]
 then
-  docker-compose down -v
+  docker compose -f docker/docker-compose.yml down -v
   mvn clean
   exit
 fi
 
   mvn clean
   exit
 fi
 
-docker-compose up -d zookeeper kafka cli
+docker compose -f docker/docker-compose.yml up -d zookeeper kafka cli
 
 if [[
   $(docker image ls -q $IMAGE) == "" ||
 
 if [[
   $(docker image ls -q $IMAGE) == "" ||
@@ -23,9 +23,9 @@ else
 fi
 
 echo "Waiting for the Kafka-Cluster to become ready..."
 fi
 
 echo "Waiting for the Kafka-Cluster to become ready..."
-docker-compose exec cli cub kafka-ready -b kafka:9092 1 60 > /dev/null 2>&1 || exit 1
-docker-compose up setup
-docker-compose up -d producer
+docker compose -f docker/docker-compose.yml exec cli cub kafka-ready -b kafka:9092 1 60 > /dev/null 2>&1 || exit 1
+docker compose -f docker/docker-compose.yml up setup
+docker compose -f docker/docker-compose.yml up -d producer
 sleep 5
 sleep 5
-docker-compose stop producer
-docker-compose logs producer
+docker compose -f docker/docker-compose.yml stop producer
+docker compose -f docker/docker-compose.yml logs producer
diff --git a/docker-compose.yml b/docker-compose.yml
deleted file mode 100644 (file)
index 59a8968..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-version: '3.2'
-services:
-  zookeeper:
-    image: confluentinc/cp-zookeeper:7.1.3
-    environment:
-      ZOOKEEPER_CLIENT_PORT: 2181
-    ports:
-      - 2181:2181
-
-  kafka:
-    image: confluentinc/cp-kafka:7.1.3
-    environment:
-      KAFKA_BROKER_ID: 1
-      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
-      KAFKA_LISTENERS: DOCKER://:9092, LOCALHOST://:9082
-      KAFKA_ADVERTISED_LISTENERS: DOCKER://kafka:9092, LOCALHOST://localhost:9082
-      KAFKA_INTER_BROKER_LISTENER_NAME: DOCKER
-      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: DOCKER:PLAINTEXT, LOCALHOST:PLAINTEXT
-      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
-      KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false"
-    ports:
-      - 9092:9082
-      - 9082:9082
-    depends_on:
-      - zookeeper
-
-  setup:
-    image: juplo/toolbox
-    command: >
-      bash -c "
-        kafka-topics --bootstrap-server kafka:9092 --delete --if-exists --topic test
-        kafka-topics --bootstrap-server kafka:9092 --create --topic test --partitions 2
-      "
-
-  cli:
-    image: juplo/toolbox
-    command: sleep infinity
-
-  producer:
-    image: juplo/spring-endless-stream-producer:1.0-SNAPSHOT
-    ports:
-      - 8080:8080
-    environment:
-      server.port: 8080
-      spring.kafka.bootstrap-servers: kafka:9092
-      spring.kafka.client-id: producer
-      spring.kafka.template.default-topic: test
-      producer.throttle-ms: 200
diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml
new file mode 100644 (file)
index 0000000..f34c07b
--- /dev/null
@@ -0,0 +1,48 @@
+version: '3.2'
+services:
+  zookeeper:
+    image: confluentinc/cp-zookeeper:7.7.1
+    environment:
+      ZOOKEEPER_CLIENT_PORT: 2181
+    ports:
+      - 2181:2181
+
+  kafka:
+    image: confluentinc/cp-kafka:7.7.1
+    environment:
+      KAFKA_BROKER_ID: 1
+      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
+      KAFKA_LISTENERS: DOCKER://:9092, LOCALHOST://:9082
+      KAFKA_ADVERTISED_LISTENERS: DOCKER://kafka:9092, LOCALHOST://localhost:9082
+      KAFKA_INTER_BROKER_LISTENER_NAME: DOCKER
+      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: DOCKER:PLAINTEXT, LOCALHOST:PLAINTEXT
+      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
+      KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false"
+    ports:
+      - 9092:9082
+      - 9082:9082
+    depends_on:
+      - zookeeper
+
+  setup:
+    image: juplo/toolbox
+    command: >
+      bash -c "
+        kafka-topics --bootstrap-server kafka:9092 --delete --if-exists --topic test
+        kafka-topics --bootstrap-server kafka:9092 --create --topic test --partitions 2
+      "
+
+  cli:
+    image: juplo/toolbox
+    command: sleep infinity
+
+  producer:
+    image: juplo/spring-endless-stream-producer:1.0-SNAPSHOT
+    ports:
+      - 8080:8080
+    environment:
+      server.port: 8080
+      spring.kafka.bootstrap-servers: kafka:9092
+      spring.kafka.client-id: producer
+      spring.kafka.template.default-topic: test
+      producer.throttle-ms: 200