WIP: Nicht vollendete Umbauten für spring-integration
[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_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
21       KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
22       KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false"
23     ports:
24       - 9092:9082
25       - 9082:9082
26     depends_on:
27       - zookeeper
28
29
30   traefik:
31     image: "traefik:v2.5"
32     command:
33       #- "--log.level=DEBUG"
34       - "--api.insecure=true"
35       - "--providers.docker=true"
36       - "--providers.docker.exposedbydefault=false"
37       - "--entrypoints.web.address=:80"
38     ports:
39       - "80:80"
40       - "8080:8080"
41     volumes:
42       - "/var/run/docker.sock:/var/run/docker.sock:ro"
43
44   recorder:
45     image: juplo/wordcount--recorder:1.0.1
46     labels:
47       - "traefik.enable=true"
48       - "traefik.http.routers.recorder.rule=Host(`recorder.localhost`)"
49       - "traefik.http.routers.recorder.entrypoints=web"
50     environment:
51       juplo.wordcount.recorder.bootstrap-server: kafka:9092
52     depends_on:
53       - kafka
54
55   users:
56     image: juplo/wordcount--users:1.0.4
57     labels:
58       - "traefik.enable=true"
59       - "traefik.http.routers.users.rule=Host(`users.localhost`)"
60       - "traefik.http.routers.users.entrypoints=web"
61     environment:
62       juplo.wordcount.users.bootstrap-server: kafka:9092
63     depends_on:
64       - kafka
65
66   splitter:
67     image: juplo/wordcount--splitter:1.0.0-spring-integration
68     labels:
69       - "traefik.enable=true"
70       - "traefik.http.routers.splitter.rule=Host(`splitter.localhost`)"
71       - "traefik.http.routers.splitter.entrypoints=web"
72     environment:
73       spring.kafka.bootstrap-servers: kafka:9092
74     depends_on:
75       - kafka
76
77   counter:
78     image: juplo/wordcount--counter:1.1.0
79     labels:
80       - "traefik.enable=true"
81       - "traefik.http.routers.counter.rule=Host(`counter.localhost`)"
82       - "traefik.http.routers.counter.entrypoints=web"
83     environment:
84       juplo.wordcount.counter.bootstrap-server: kafka:9092
85     depends_on:
86       - kafka
87
88   top10:
89     image: juplo/wordcount--top10:1.0.1
90     labels:
91       - "traefik.enable=true"
92       - "traefik.http.routers.top10.rule=Host(`top10.localhost`)"
93       - "traefik.http.routers.top10.entrypoints=web"
94     environment:
95       juplo.wordcount.top10.bootstrap-server: kafka:9092
96     depends_on:
97       - kafka
98
99   query:
100     image: juplo/wordcount--query:1.0.4
101     labels:
102       - "traefik.enable=true"
103       - "traefik.http.routers.query.rule=Host(`query.localhost`)"
104       - "traefik.http.routers.query.entrypoints=web"
105     environment:
106       juplo.wordcount.query.bootstrap-server: kafka:9092
107     depends_on:
108       - kafka
109
110   bart:
111     image: juplo/wordcount--fortune:1.0.0
112     command: bash -c "
113       while [ true ];
114       do
115         /usr/games/fortune chalkboard
116           | head -1
117           | http -v recorder:8081/bart;
118         echo;
119         sleep 1;
120       done"
121
122   nerd:
123     image: juplo/wordcount--fortune:1.0.0
124     command: bash -c "
125       while [ true ];
126       do
127         /usr/games/fortune computers
128           | grep  -v '^[[:space:]]*--'
129           | http -v recorder:8081/nerd;
130         echo;
131         sleep 1;
132       done"
133
134   riddler:
135     image: juplo/wordcount--fortune:1.0.0
136     command: bash -c "
137       while [ true ];
138       do
139         /usr/games/fortune riddles
140           | awk -F':' '/^Q/ { print $$2 }'
141           | http -v recorder:8081/riddler;
142         echo;
143         sleep 1;
144       done"
145
146   cli:
147     image: juplo/toolbox
148     command: bash -c "
149       cub kafka-ready -b kafka:9092 1 60 ;
150       kafka-topics --bootstrap-server kafka:9092 --create --partitions 10 --if-not-exists --topic recordings ;
151       kafka-topics --bootstrap-server kafka:9092 --create --partitions 10 --if-not-exists --topic users ;
152       kafka-topics --bootstrap-server kafka:9092 --create --partitions 10 --if-not-exists --topic words ;
153       kafka-topics --bootstrap-server kafka:9092 --create --partitions 10 --if-not-exists --topic countings ;
154       kafka-topics --bootstrap-server kafka:9092 --create --partitions 10 --if-not-exists --topic top10 ;
155       sleep infinity"
156
157   akhq:
158     image: tchiotludo/akhq:0.18.0
159     labels:
160       - "traefik.enable=true"
161       - "traefik.http.routers.akhq.rule=Host(`akhq.localhost`)"
162       - "traefik.http.routers.akhq.entrypoints=web"
163     expose:
164       - 8080
165     environment:
166       AKHQ_CONFIGURATION: |
167         akhq:
168           connections:
169             docker-kafka-server:
170               properties:
171                 bootstrap.servers: "kafka:9092"
172
173 networks:
174   default:
175     external:
176       name: trion