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 mongo: image: mongo:4.4.13 ports: - 27017:27017 environment: 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 producer: image: juplo/endless-long-producer:1.0-SNAPSHOT ports: - 8080:8080 environment: server.port: 8080 producer.bootstrap-server: kafka:9092 producer.client-id: producer producer.topic: test producer.throttle-ms: 500 peter: image: juplo/endless-consumer:1.0-SNAPSHOT ports: - 8081:8080 environment: server.port: 8080 consumer.bootstrap-server: kafka:9092 consumer.client-id: peter consumer.topic: test spring.data.mongodb.uri: mongodb://juplo:training@mongo:27017 spring.data.mongodb.database: juplo beate: image: juplo/endless-consumer:1.0-SNAPSHOT ports: - 8082:8080 environment: server.port: 8080 consumer.bootstrap-server: kafka:9092 consumer.client-id: beate consumer.topic: test spring.data.mongodb.uri: mongodb://juplo:training@mongo:27017 spring.data.mongodb.database: juplo