version: '3.2'
services:
zookeeper:
- image: confluentinc/cp-zookeeper:6.2.0
+ image: confluentinc/cp-zookeeper:7.1.3
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ports:
- 2181:2181
kafka:
- image: confluentinc/cp-kafka:6.2.0
+ image: confluentinc/cp-kafka:7.1.3
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
depends_on:
- zookeeper
- kafka-ui:
- image: provectuslabs/kafka-ui:0.3.3
+ mongo:
+ image: mongo:4.4.13
ports:
- - 8080:8080
+ - 27017:27017
environment:
- KAFKA_CLUSTERS_0_NAME: local
- KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:9092
+ MONGO_INITDB_ROOT_USERNAME: juplo
+ MONGO_INITDB_ROOT_PASSWORD: training
+
+ express:
+ image: mongo-express
+ ports:
+ - 8090:8081
+ environment:
+ ME_CONFIG_MONGODB_ADMINUSERNAME: juplo
+ ME_CONFIG_MONGODB_ADMINPASSWORD: training
+ ME_CONFIG_MONGODB_URL: mongodb://juplo:training@mongo:27017/
+ depends_on:
+ - mongo
+
+ 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
+ bart:
+ image: juplo/wordcount--fortune:1.0.0
+ command: bash -c "
+ while [ true ];
+ do
+ /usr/games/fortune chalkboard
+ | head -1
+ | http -v producer: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 producer: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 producer:8080/riddler;
+ echo;
+ sleep 1;
+ sleep 1;
+ done"
+
+ kraut:
+ image: juplo/wordcount--fortune:1.0.0
+ command: bash -c "
+ while [ true ];
+ do
+ /usr/games/fortune de
+ | http -v producer:8080/kraut;
+ echo;
+ sleep 1;
+ done"
+
+ poet:
+ image: juplo/wordcount--fortune:1.0.0
+ command: bash -c "
+ while [ true ];
+ do
+ /usr/games/fortune songs-poems
+ | http -v producer:8080/poet;
+ echo;
+ sleep 1;
+ done"
+
+ linux:
+ image: juplo/wordcount--fortune:1.0.0
+ command: bash -c "
+ while [ true ];
+ do
+ /usr/games/fortune linux
+ | http -v producer:8080/linux;
+ echo;
+ sleep 1;
+ done"
+
producer:
- image: juplo/endless-producer:1.0-SNAPSHOT
+ image: juplo/rest-producer:1.0-SNAPSHOT
ports:
- - 8000:8080
+ - 8080:8080
environment:
+ server.port: 8080
producer.bootstrap-server: kafka:9092
producer.client-id: producer
producer.topic: test
- producer.throttle-ms: 10
+ consumer-1:
+ image: juplo/wordcount:1.0-SNAPSHOT
+ ports:
+ - 8081:8080
+ environment:
+ server.port: 8080
+ consumer.bootstrap-server: kafka:9092
+ consumer.client-id: consumer-1
+ consumer.topic: test
+ spring.data.mongodb.uri: mongodb://juplo:training@mongo:27017
+ spring.data.mongodb.database: juplo
- consumer:
- image: juplo/counting-consumer:1.0-SNAPSHOT
+ consumer-2:
+ image: juplo/wordcount:1.0-SNAPSHOT
ports:
- - 8081:8081
+ - 8082:8080
environment:
+ server.port: 8080
consumer.bootstrap-server: kafka:9092
- consumer.client-id: my-group
- consumer.client-id: consumer
+ consumer.client-id: consumer-2
consumer.topic: test
+ spring.data.mongodb.uri: mongodb://juplo:training@mongo:27017
+ spring.data.mongodb.database: juplo