Synchronisation bei Start/Stop repariert und Ausgabe für Fehler ergänzt
[demos/kafka/training] / docker-compose.yml
1 version: '3.2'
2 services:
3   zookeeper:
4     image: confluentinc/cp-zookeeper:6.2.0
5     environment:
6       ZOOKEEPER_CLIENT_PORT: 2181
7     ports:
8       - 2181:2181
9
10   kafka:
11     image: confluentinc/cp-kafka:6.2.0
12     environment:
13       KAFKA_BROKER_ID: 1
14       KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
15       KAFKA_LISTENERS: DOCKER://:9092, LOCALHOST://:9082
16       KAFKA_ADVERTISED_LISTENERS: DOCKER://kafka:9092, LOCALHOST://localhost:9082
17       KAFKA_INTER_BROKER_LISTENER_NAME: DOCKER
18       KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: DOCKER:PLAINTEXT, LOCALHOST:PLAINTEXT
19       KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
20       KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false"
21     ports:
22       - 9092:9082
23       - 9082:9082
24     depends_on:
25       - zookeeper
26
27   setup:
28     image: juplo/toolbox
29     command: >
30       bash -c "
31         kafka-topics --bootstrap-server kafka:9092 --delete --if-exists --topic test
32         kafka-topics --bootstrap-server kafka:9092 --create --topic test --partitions 2
33       "
34
35   cli:
36     image: juplo/toolbox
37     command: sleep infinity
38
39   producer:
40     image: juplo/endless-producer:1.0-SNAPSHOT
41     ports:
42       - 8080:8080
43     environment:
44       producer.bootstrap-server: kafka:9092
45       producer.client-id: producer
46       producer.topic: test
47       producer.throttle-ms: 200