X-Git-Url: https://juplo.de/gitweb/?a=blobdiff_plain;f=docker-compose.yml;h=41716af94e6a8916838e0af26cffb668a7696dcf;hb=cbf1b641e147552fdbafb1b440a5aab59dfe275f;hp=f057280836c9f3390337a4ee8240174a8e2a2683;hpb=f64dcbd9e3a03a070e5cf2efbf255e7212ce406e;p=demos%2Fkafka%2Fwordcount diff --git a/docker-compose.yml b/docker-compose.yml index f057280..41716af 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,3 @@ -version: '3.2' services: kafka: @@ -37,6 +36,7 @@ services: volumes: - "/var/run/docker.sock:/var/run/docker.sock:ro" + recorder: image: juplo/wordcount--recorder:1.0.1 labels: @@ -103,6 +103,7 @@ services: depends_on: - kafka + bart: image: juplo/wordcount--fortune:1.0.0 command: bash -c " @@ -139,16 +140,97 @@ services: sleep 1; done" + cli: image: juplo/toolbox - command: bash -c " - cub kafka-ready -b kafka:9092 1 60 ; - kafka-topics --bootstrap-server kafka:9092 --create --partitions 10 --if-not-exists --topic recordings ; - kafka-topics --bootstrap-server kafka:9092 --create --partitions 10 --if-not-exists --topic users ; - kafka-topics --bootstrap-server kafka:9092 --create --partitions 10 --if-not-exists --topic words ; - kafka-topics --bootstrap-server kafka:9092 --create --partitions 10 --if-not-exists --topic countings ; - kafka-topics --bootstrap-server kafka:9092 --create --partitions 10 --if-not-exists --topic top10 ; - sleep infinity" + command: sleep infinity + stop_grace_period: 0s + depends_on: + - kafka + - traefik + + setup: + image: juplo/toolbox + command: + - bash + - -c + - | + cub kafka-ready -b kafka:9092 1 60 > /dev/null 2>&1 || exit 1 + if [ -e INITIALIZED ] + then + echo -n Bereits konfiguriert: + cat INITIALIZED + kafka-topics --bootstrap-server kafka:9092 --describe --topic users + kafka-topics --bootstrap-server kafka:9092 --describe --topic recordings + kafka-topics --bootstrap-server kafka:9092 --describe --topic words + kafka-topics --bootstrap-server kafka:9092 --describe --topic countings + kafka-topics --bootstrap-server kafka:9092 --describe --topic top10 + else + kafka-topics --bootstrap-server kafka:9092 \ + --delete \ + --if-exists \ + --topic users + kafka-topics --bootstrap-server kafka:9092 \ + --delete \ + --if-exists \ + --topic recordings + kafka-topics --bootstrap-server kafka:9092 \ + --delete \ + --if-exists \ + --topic words + kafka-topics --bootstrap-server kafka:9092 \ + --delete \ + --if-exists \ + --topic countings + kafka-topics --bootstrap-server kafka:9092 \ + --delete \ + --if-exists \ + --topic top10 + kafka-topics --bootstrap-server kafka:9092 \ + --create \ + --topic users \ + --partitions 3 \ + --replication-factor 1 \ + --config min.insync.replicas=1 \ + && echo Das Topic \'users\' wurde erfolgreich angelegt: \ + && kafka-topics --bootstrap-server kafka:9092 --describe --topic users \ + && kafka-topics --bootstrap-server kafka:9092 \ + --create \ + --topic recordings \ + --partitions 3 \ + --replication-factor 1 \ + --config min.insync.replicas=1 \ + && echo Das Topic \'recordings\' wurde erfolgreich angelegt: \ + && kafka-topics --bootstrap-server kafka:9092 --describe --topic recordings \ + && kafka-topics --bootstrap-server kafka:9092 \ + --create \ + --topic words \ + --partitions 3 \ + --replication-factor 1 \ + --config min.insync.replicas=1 \ + && echo Das Topic \'words\' wurde erfolgreich angelegt: \ + && kafka-topics --bootstrap-server kafka:9092 --describe --topic words \ + && kafka-topics --bootstrap-server kafka:9092 \ + --create \ + --topic countings \ + --partitions 3 \ + --replication-factor 1 \ + --config min.insync.replicas=1 \ + && echo Das Topic \'countings\' wurde erfolgreich angelegt: \ + && kafka-topics --bootstrap-server kafka:9092 --describe --topic countings \ + && kafka-topics --bootstrap-server kafka:9092 \ + --create \ + --topic top10 \ + --partitions 3 \ + --replication-factor 1 \ + --config min.insync.replicas=1 \ + && echo Das Topic \'top10\' wurde erfolgreich angelegt: \ + && kafka-topics --bootstrap-server kafka:9092 --describe --topic top10 \ + && date > INITIALIZED + fi + stop_grace_period: 0s + depends_on: + - cli akhq: image: tchiotludo/akhq:0.18.0