version: '3.2' services: zookeeper: image: confluentinc/cp-zookeeper:6.2.0 environment: ZOOKEEPER_CLIENT_PORT: 2181 ports: - 2181:2181 kafka: image: confluentinc/cp-kafka:6.2.0 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 recorder: image: juplo/wordcount--recorder:1.0.0 environment: juplo.wordcount.recorder.bootstrap-server: kafka:9092 juplo.wordcount.recorder.topic: recordings ports: - 8081:8080 depends_on: - kafka users: image: juplo/wordcount--users:1.0.2 environment: juplo.wordcount.users.bootstrap-server: kafka:9092 juplo.wordcount.users.topic: users ports: - 8082:8080 depends_on: - kafka counter: image: juplo/wordcount--counter:1.0.0 environment: juplo.wordcount.counter.bootstrap-server: kafka:9092 juplo.wordcount.counter.application-id: counter juplo.wordcount.counter.input-topic: recordings juplo.wordcount.counter.output-topic: countings ports: - 8083:8080 depends_on: - kafka top10: image: juplo/wordcount--top10:1.0.0 environment: juplo.wordcount.top10.bootstrap-server: kafka:9092 juplo.wordcount.top10.application-id: top10 juplo.wordcount.top10.input-topic: countings juplo.wordcount.top10.output-topic: top10 ports: - 8084:8080 depends_on: - kafka query: image: juplo/wordcount--query:1.0.2 environment: juplo.wordcount.query.bootstrap-server: kafka:9092 juplo.wordcount.query.application-id: query juplo.wordcount.query.ranking-input-topic: top10 juplo.wordcount.query.users-input-topic: users ports: - 8085:8080 depends_on: - kafka bart: image: juplo/wordcount--fortune:1.0.0 command: bash -c " while [ true ]; do /usr/games/fortune chalkboard | head -1 | http -v recorder:8080/bart; echo; sleep 1; done" nerd: image: juplo/wordcount--fortune:1.0.0 command: bash -c " while [ true ]; do /usr/games/fortune computers | grep -v '^[[:space:]]*--' | http -v recorder:8080/nerd; echo; sleep 1; done" riddler: image: juplo/wordcount--fortune:1.0.0 command: bash -c " while [ true ]; do /usr/games/fortune riddles | awk -F':' '/^Q/ { print $$2 }' | http -v recorder:8080/riddler; echo; 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 --topic recordings ; kafka-topics --bootstrap-server kafka:9092 --create --partitions 10 --topic users ; kafka-topics --bootstrap-server kafka:9092 --create --partitions 10 --topic countings ; kafka-topics --bootstrap-server kafka:9092 --create --partitions 10 --topic top10 ; sleep infinity" networks: default: external: name: trion