From 7b3a6be817b9d417f4c36cc9ea36bfa5a1bda343 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 11 Jun 2023 09:40:54 +0200 Subject: [PATCH] Docker-Setup in das Unterverzeichnis `docker` verschoben --- README.sh | 20 +++++++++---------- .../docker-compose.yml | 0 2 files changed, 10 insertions(+), 10 deletions(-) rename docker-compose.yml => docker/docker-compose.yml (100%) diff --git a/README.sh b/README.sh index 76ed9c3..fae0348 100755 --- a/README.sh +++ b/README.sh @@ -4,13 +4,13 @@ IMAGE=juplo/rest-producer:1.0-SNAPSHOT if [ "$1" = "cleanup" ] then - docker-compose down -v --remove-orphans + docker-compose -f docker/docker-compose.yml down -v --remove-orphans mvn clean exit fi -docker-compose up -d kafka-1 kafka-2 kafka-3 cli -docker-compose rm -svf producer producer-0 producer-1 +docker-compose -f docker/docker-compose.yml up -d kafka-1 kafka-2 kafka-3 cli +docker-compose -f docker/docker-compose.yml rm -svf producer producer-0 producer-1 if [[ $(docker image ls -q $IMAGE) == "" || @@ -23,11 +23,11 @@ else docker image ls $IMAGE fi -docker-compose up setup -docker-compose up -d producer-0 producer-1 +docker-compose -f docker/docker-compose.yml up setup +docker-compose -f docker/docker-compose.yml up -d producer-0 producer-1 while ! [[ $(http 0:8000/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for producer-0..."; sleep 1; done while ! [[ $(http 0:8001/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for producer-1..."; sleep 1; done -docker-compose up -d consumer +docker-compose -f docker/docker-compose.yml up -d consumer # tag::http[] echo -n Nachricht 1 an Producer 0 | http -v :8000/foo @@ -36,9 +36,9 @@ echo -n Nachricht 1 an Producer 1 | http -v :8001/foo echo -n Nachricht 2 an Producer 0 | http -v :8000/bar echo -n Nachricht 2 an Producer 1 | http -v :8001/bar -docker-compose logs consumer +docker-compose -f docker/docker-compose.yml logs consumer -docker-compose exec -T cli bash << 'EOF' +docker-compose -f docker/docker-compose.yml exec -T cli bash << 'EOF' echo "Altering number of partitions from 3 to 7..." kafka-topics --bootstrap-server kafka:9092 --describe --topic test # tag::repartitioning[] @@ -47,7 +47,7 @@ kafka-topics --bootstrap-server kafka:9092 --alter --topic test --partitions 7 kafka-topics --bootstrap-server kafka:9092 --describe --topic test EOF -docker-compose restart producer-0 producer-1 +docker-compose -f docker/docker-compose.yml restart producer-0 producer-1 while ! [[ $(http 0:8000/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for producer-0..."; sleep 1; done while ! [[ $(http 0:8001/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for producer-1..."; sleep 1; done @@ -56,7 +56,7 @@ echo -n Nachricht 3 an Producer 1 | http -v :8001/foo echo -n Nachricht 4 an Producer 0 | http -v :8000/bar echo -n Nachricht 4 an Producer 1 | http -v :8001/bar -docker-compose logs consumer +docker-compose -f docker/docker-compose.yml logs consumer # tag::kafkacat[] kafkacat -b :9092 -t test -o 0 -p0 -f'p=%p|o=%o|k=%k|v=%s\n' -qe diff --git a/docker-compose.yml b/docker/docker-compose.yml similarity index 100% rename from docker-compose.yml rename to docker/docker-compose.yml -- 2.20.1