-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
executable file
·97 lines (90 loc) · 2.43 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
version: "3"
networks:
test:
services:
mosquitto:
image: eclipse-mosquitto:latest
volumes:
- ./mosquitto:/mosquitto/config
ports:
- 1883:1883
- 8883:8883
networks:
- test
zookeeper:
image: 'bitnami/zookeeper:latest'
ports:
- '2181:2181'
environment:
- ALLOW_ANONYMOUS_LOGIN=yes
networks:
- test
kafka:
image: 'bitnami/kafka:latest'
ports:
- '9092:9092'
# volumes:
# - ./kafka:/bitnami/kafka
environment:
- KAFKA_BROKER_ID=1
- KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
- ALLOW_PLAINTEXT_LISTENER=yes
# - KAFKA_ADVERTISED_LISTENERS='SSL://kafka:9092'
# - KAFKA_SSL_KEYSTORE_FILENAME=/bitnami/kafka/client.key
# - KAFKA_SSL_KEYSTORE_CREDENTIALS=cert_creds
# - KAFKA_SSL_KEY_CREDENTIALS=cert_creds
# - KAFKA_SSL_TRUSTSTORE_FILENAME=/bitnami/kafka/client.crt
# - KAFKA_SSL_TRUSTSTORE_CREDENTIALS=cert_creds
# - KAFKA_SSL_CLIENT_AUTH='required'
# - KAFKA_SECURITY_PROTOCOL=SSL
# - KAFKA_SECURITY_INTER_BROKER_PROTOCOL=SSL
# - KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1
depends_on:
- zookeeper
networks:
- test
kowl:
image: quay.io/cloudhut/kowl
ports:
- 12345:8080
environment:
- KAFKA_BROKERS=kafka:9092
depends_on:
- kafka
- mosquitto
- zookeeper
- init-kafka
networks:
- test
init-kafka:
image: confluentinc/cp-kafka:latest
entrypoint: [ '/bin/bash', '-c' ]
command: "'kafka-topics --bootstrap-server kafka:9092 --create --if-not-exists --topic test1-kafka --replication-factor 1 --partitions 1;\
kafka-topics --bootstrap-server kafka:9092 --create --if-not-exists --topic test2-kafka --replication-factor 1 --partitions 1;\
kafka-topics --bootstrap-server kafka:9092 --list;'"
depends_on:
- kafka
- mosquitto
networks:
- test
kafka-mqtt-connector:
build: ./app
environment:
- MQTT_HOST=mosquitto
- MQTT_PORT=1883
- MQTT_CLIENT_ID=mqtt-client-1
- MQTT_QOS=0
- KAFKA_HOST=kafka
- KAFKA_PORT=9092
- KAFKA_CLIENT_ID=testing-kafka-producer-1
- TOPIC_MAPPING=test1-mqtt>>test1-kafka;test2-mqtt<<test2-kafka
volumes:
- "./app:/services"
stdin_open: true # docker run -i
tty: true # docker run -t
depends_on:
- kafka
- mosquitto
- init-kafka
networks:
- test