Tags für Asciidoc hinzugefügt
[demos/kafka/training] / docker-compose.yml
1 version: '3.2'
2 services:
3   zookeeper:
4     image: confluentinc/cp-zookeeper:7.1.3
5     environment:
6       ZOOKEEPER_CLIENT_PORT: 2181
7     ports:
8       - 2181:2181
9
10   kafka-1:
11     image: confluentinc/cp-kafka:7.1.3
12     environment:
13       KAFKA_BROKER_ID: 1
14       KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
15       KAFKA_LISTENERS: DOCKER://:9092, LOCALHOST://:9081
16       KAFKA_ADVERTISED_LISTENERS: DOCKER://kafka-1:9092, LOCALHOST://localhost:9081
17       KAFKA_INTER_BROKER_LISTENER_NAME: DOCKER
18       KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: DOCKER:PLAINTEXT, LOCALHOST:PLAINTEXT
19       KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 3
20       KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false"
21     ports:
22       - 9081:9081
23     depends_on:
24       - zookeeper
25
26   kafka-2:
27     image: confluentinc/cp-kafka:7.1.3
28     environment:
29       KAFKA_BROKER_ID: 2
30       KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
31       KAFKA_LISTENERS: DOCKER://:9092, LOCALHOST://:9082
32       KAFKA_ADVERTISED_LISTENERS: DOCKER://kafka-2:9092, LOCALHOST://localhost:9082
33       KAFKA_INTER_BROKER_LISTENER_NAME: DOCKER
34       KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: DOCKER:PLAINTEXT, LOCALHOST:PLAINTEXT
35       KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 3
36       KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false"
37     ports:
38       - 9092:9082
39       - 9082:9082
40     networks:
41       default:
42         aliases:
43           - kafka
44     depends_on:
45       - zookeeper
46
47   kafka-3:
48     image: confluentinc/cp-kafka:7.1.3
49     environment:
50       KAFKA_BROKER_ID: 3
51       KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
52       KAFKA_LISTENERS: DOCKER://:9092, LOCALHOST://:9083
53       KAFKA_ADVERTISED_LISTENERS: DOCKER://kafka-3:9092, LOCALHOST://localhost:9083
54       KAFKA_INTER_BROKER_LISTENER_NAME: DOCKER
55       KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: DOCKER:PLAINTEXT, LOCALHOST:PLAINTEXT
56       KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 3
57       KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false"
58     ports:
59       - 9083:9083
60     depends_on:
61       - zookeeper
62
63
64   setup:
65     image: juplo/toolbox
66     command: >
67       bash -c "
68         kafka-topics --bootstrap-server kafka:9092 --create --if-not-exists --topic in --partitions 2 --replication-factor 3 --config min.insync.replicas=2
69         kafka-topics --bootstrap-server kafka:9092 --create --if-not-exists --topic out --partitions 2 --replication-factor 3 --config min.insync.replicas=2  
70         kafka-topics --bootstrap-server kafka:9092 --describe --topic in
71         kafka-topics --bootstrap-server kafka:9092 --describe --topic out
72       "
73
74   cli:
75     image: juplo/toolbox
76     command: sleep infinity
77
78   gateway:
79     image: juplo/sumup-gateway--springified:1.0-SNAPSHOT
80     ports:
81       - 8080:8080
82     environment:
83       server.port: 8080
84       spring.kafka.bootstrap-servers: kafka:9092
85       spring.kafka.client-id: gateway
86       sumup.gateway.topic: in
87
88   requests-1:
89     image: juplo/sumup-requests-json:1.0-SNAPSHOT
90     ports:
91       - 8081:8080
92     environment:
93       server.port: 8080
94       sumup.requests.bootstrap-server: kafka:9092
95       sumup.requests.client-id: requests-1
96
97   requests-2:
98     image: juplo/sumup-requests-json:1.0-SNAPSHOT
99     ports:
100       - 8082:8080
101     environment:
102       server.port: 8080
103       sumup.requests.bootstrap-server: kafka:9092
104       sumup.requests.client-id: requests-2
105
106   supersimple:
107     image: juplo/supersimple:1.0-SNAPSHOT
108     ports:
109       - 8090:8080
110     environment:
111       server.port: 8080
112       spring.kafka.bootstrap-servers: kafka:9092
113       spring.kafka.producer.bootstrap-servers: kafka:9092
114       spring.kafak.client-id: supersimple
115       logging.level.org.apache.kafka.clients.consumer: INFO