WIP: Avro-Holzweg
[demos/kafka/wordcount] / 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   schema-registry:
28     image: confluentinc/cp-schema-registry:6.2.0
29     hostname: schema-registry
30     ports:
31       - "9081:9081"
32     environment:
33       SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: PLAINTEXT://kafka:9092
34       SCHEMA_REGISTRY_HOST_NAME: schema-registry
35       SCHEMA_REGISTRY_LISTENERS: http://0.0.0.0:9081
36     depends_on:
37       - zookeeper
38       - kafka
39
40
41   recorder:
42     image: juplo/wordcount--recorder:1.0.0
43     environment:
44       juplo.wordcount.recorder.bootstrap-server: kafka:9092
45       juplo.wordcount.recorder.topic: recordings
46     ports:
47       - 8081:8080
48     depends_on:
49       - kafka
50
51   users:
52     image: juplo/wordcount--users:2.0-avro-SNAPSHOT
53     environment:
54       juplo.wordcount.users.bootstrap-server: kafka:9092
55       juplo.wordcount.users.topic: users
56     ports:
57       - 8082:8080
58     depends_on:
59       - kafka
60
61   counter:
62     image: juplo/wordcount--counter:2.0-avro-SNAPSHOT
63     environment:
64       juplo.wordcount.counter.bootstrap-server: kafka:9092
65       juplo.wordcount.counter.application-id: counter
66       juplo.wordcount.counter.input-topic: recordings
67       juplo.wordcount.counter.output-topic: countings
68     ports:
69       - 8083:8080
70     depends_on:
71       - kafka
72
73   top10:
74     image: juplo/wordcount--top10:2.0-avro-SNAPSHOT
75     environment:
76       juplo.wordcount.top10.bootstrap-server: kafka:9092
77       juplo.wordcount.top10.application-id: top10
78       juplo.wordcount.top10.input-topic: countings
79       juplo.wordcount.top10.output-topic: top10
80     ports:
81       - 8084:8080
82     depends_on:
83       - kafka
84
85   query:
86     image: juplo/wordcount--query:2.0-avro-SNAPSHOT
87     environment:
88       juplo.wordcount.query.bootstrap-server: kafka:9092
89       juplo.wordcount.query.application-id: query
90       juplo.wordcount.query.ranking-input-topic: top10
91       juplo.wordcount.query.users-input-topic: users
92     ports:
93       - 8085:8080
94     depends_on:
95       - kafka
96
97   bart:
98     image: juplo/wordcount--fortune:1.0.0
99     command: bash -c "
100       while [ true ];
101       do
102         /usr/games/fortune chalkboard
103           | head -1
104           | http -v recorder:8080/bart;
105         echo;
106         sleep 1;
107       done"
108
109   nerd:
110     image: juplo/wordcount--fortune:1.0.0
111     command: bash -c "
112       while [ true ];
113       do
114         /usr/games/fortune computers
115           | grep  -v '^[[:space:]]*--'
116           | http -v recorder:8080/nerd;
117         echo;
118         sleep 1;
119       done"
120
121   riddler:
122     image: juplo/wordcount--fortune:1.0.0
123     command: bash -c "
124       while [ true ];
125       do
126         /usr/games/fortune riddles
127           | awk -F':' '/^Q/ { print $$2 }'
128           | http -v recorder:8080/riddler;
129         echo;
130         sleep 1;
131       done"
132
133   cli:
134     image: juplo/toolbox
135     command: bash -c "
136       cub kafka-ready -b kafka:9092 1 60 ;
137       kafka-topics --bootstrap-server kafka:9092 --create --partitions 10 --topic recordings ;
138       kafka-topics --bootstrap-server kafka:9092 --create --partitions 10 --topic users ;
139       kafka-topics --bootstrap-server kafka:9092 --create --partitions 10 --topic countings ;
140       kafka-topics --bootstrap-server kafka:9092 --create --partitions 10 --topic top10 ;
141       sleep infinity"
142
143 networks:
144   default:
145     external:
146       name: trion