-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
310 lines (291 loc) · 8.73 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
version: "3"
networks:
iotwin-network:
ipam:
config:
- subnet: 172.20.0.0/24
crdb-network:
driver: bridge
volumes:
crdbdata:
driver: local
pgdata:
driver: local
pgadmin:
driver: local
services:
zookeeper1:
restart: always
image: 'wurstmeister/zookeeper:latest'
container_name: zookeeper1
hostname: zookeeper1
#expose:
# - "2181"
#ports:
# - '127.0.0.1:2181:2181'
ports:
- '2181:2181'
environment:
ZOOKEEPER_SERVER_ID: 1
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
ZOOKEEPER_INIT_LIMIT: 5
ZOOKEEPER_SYNC_LIMIT: 2
ZOOKEEPER_SERVERS: zookeeper1:2888:3888;zookeeper2:2888:3888;zookeeper3:2888:3888
networks:
iotwin-network:
ipv4_address: 172.20.0.21
zookeeper2:
restart: always
image: 'wurstmeister/zookeeper:latest'
container_name: zookeeper2
hostname: zookeeper2
#expose:
# - "2182"
#ports:
# - '127.0.0.1:2182:2182'
ports:
- '2182:2182'
environment:
ZOOKEEPER_SERVER_ID: 2
ZOOKEEPER_CLIENT_PORT: 2182
ZOOKEEPER_TICK_TIME: 2000
ZOOKEEPER_INIT_LIMIT: 5
ZOOKEEPER_SYNC_LIMIT: 2
ZOOKEEPER_SERVERS: zookeeper1:2888:3888;zookeeper2:2888:3888;zookeeper3:2888:3888
networks:
iotwin-network:
ipv4_address: 172.20.0.22
zookeeper3:
restart: always
image: 'wurstmeister/zookeeper:latest'
container_name: zookeeper3
hostname: zookeeper3
#expose:
# - "2183"
#ports:
# - '127.0.0.1:2183:2183'
ports:
- '2183:2183'
environment:
ZOOKEEPER_SERVER_ID: 3
ZOOKEEPER_CLIENT_PORT: 2183
ZOOKEEPER_TICK_TIME: 2000
ZOOKEEPER_INIT_LIMIT: 5
ZOOKEEPER_SYNC_LIMIT: 2
ZOOKEEPER_SERVERS: zookeeper1:2888:3888;zookeeper2:2888:3888;zookeeper3:2888:3888
networks:
iotwin-network:
ipv4_address: 172.20.0.23
kafka1:
restart: always
image: 'wurstmeister/kafka:latest'
container_name: kafka1
hostname: kafka1
#expose:
# - "9091"
#ports:
# - '127.0.0.1:9091:9091'
ports:
- '9091:9091'
environment:
#KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER_INTERNAL://kafka1:19091,LISTENER_DOCKER_EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9091
#KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER_INTERNAL:PLAINTEXT,LISTENER_DOCKER_EXTERNAL:PLAINTEXT
#KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL
KAFKA_BROKER_ID: 1
KAFKA_ADVERTISED_HOST_NAME: 127.0.0.1
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka1:9091
KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9091
KAFKA_ZOOKEEPER_CONNECT: zookeeper1:2181,zookeeper2:2182,zookeeper3:2183
#KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'false'
#KAFKA_DELETE_TOPIC_ENABLE: 'true'
#- KAFKA_ADVERTISED_HOST_NAME=127.0.0.1
#- KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://kafka1:9091
BOOTSTRAP_SERVERS: kafka1:9091,kafka2:9092,kafka3:9093
volumes:
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
- zookeeper1
- zookeeper2
- zookeeper3
networks:
iotwin-network:
ipv4_address: 172.20.0.31
kafka2:
restart: always
image: 'wurstmeister/kafka:latest'
container_name: kafka2
hostname: kafka2
#expose:
# - "9092"
#ports:
# - '127.0.0.1:9092:9092'
ports:
- '9092:9092'
environment:
#KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER_INTERNAL://kafka2:19092,LISTENER_DOCKER_EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9092
#KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER_INTERNAL:PLAINTEXT,LISTENER_DOCKER_EXTERNAL:PLAINTEXT
#KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL
KAFKA_BROKER_ID: 2
KAFKA_ADVERTISED_HOST_NAME: 127.0.0.1
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka2:9092
KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092
KAFKA_ZOOKEEPER_CONNECT: zookeeper1:2181,zookeeper2:2182,zookeeper3:2183
#KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'false'
#KAFKA_DELETE_TOPIC_ENABLE: 'true'
#- KAFKA_ADVERTISED_HOST_NAME=127.0.0.1
#- KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://kafka2:9092
BOOTSTRAP_SERVERS: kafka1:9091,kafka2:9092,kafka3:9093
volumes:
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
- zookeeper1
- zookeeper2
- zookeeper3
networks:
iotwin-network:
ipv4_address: 172.20.0.32
kafka3:
restart: always
image: 'wurstmeister/kafka:latest'
container_name: kafka3
hostname: kafka3
#expose:
# - "9093"
#ports:
# - '127.0.0.1:9093:9093'
ports:
- '9093:9093'
environment:
#KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER_INTERNAL://kafka1:19091,LISTENER_DOCKER_EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9091
#KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER_INTERNAL:PLAINTEXT,LISTENER_DOCKER_EXTERNAL:PLAINTEXT
#KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL
KAFKA_BROKER_ID: 3
KAFKA_ADVERTISED_HOST_NAME: 127.0.0.1
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka3:9093
KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9093
KAFKA_ZOOKEEPER_CONNECT: zookeeper1:2181,zookeeper2:2182,zookeeper3:2183
#KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'false'
#KAFKA_DELETE_TOPIC_ENABLE: 'true'
#- KAFKA_ADVERTISED_HOST_NAME=127.0.0.1
#- KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://kafka3:9093
BOOTSTRAP_SERVERS: kafka1:9091,kafka2:9092,kafka3:9093
volumes:
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
- zookeeper1
- zookeeper2
- zookeeper3
networks:
iotwin-network:
ipv4_address: 172.20.0.33
tb-gateway:
restart: always
image: 'thingsboard/tb-gateway'
container_name: tb-gateway
hostname: tb-gateway
ports:
- "5000:5000"
volumes:
- ./tb-gateway/config:/thingsboard_gateway/config
- ./tb-gateway/logs:/thingsboard_gateway/logs
- ./tb-gateway/extensions:/thingsboard_gateway/extensions
networks:
iotwin-network:
ipv4_address: 172.20.0.40
mosquitto_1:
restart: always
image: 'eclipse-mosquitto'
container_name: mqtt
hostname: mqtt
#expose:
# - "1883"
#ports:
# - '127.0.0.1:1883:1883'
ports:
- 1883:1883
#volumes:
#- ./mosquitto/mosquitto/config:/mosquitto/config:rw
#- ./mosquitto/mosquitto/data:/mosquitto/data
#- ./mosquitto/mosquitto/log:/mosquitto/log
networks:
iotwin-network:
ipv4_address: 172.20.0.41
mosquitto_2:
restart: always
image: eclipse-mosquitto
container_name: mqtt_gateway
hostname: mqtt_gateway
ports:
- 11883:11883
#volumes:
#- ./mosquitto/mosquitto-gateway/config:/mosquitto/config:rw
#- ./mosquitto/mosquitto-gateway/data:/mosquitto/data
#- ./mosquitto/mosquitto-gateway/log:/mosquitto/log
networks:
iotwin-network:
ipv4_address: 172.20.0.41
crdb_node1:
restart: always
image: cockroachdb/cockroach:v21.2.7
container_name: crdb_node1
hostname: crdb_node1
volumes:
- crdbdata:/cockroach/cockroach-data
command: start-single-node --insecure
#expose:
# - "26257"
# - "8080"
#ports:
# - '127.0.0.1:26257:26257'
ports:
- "26257:26257"
- "8088:8080"
networks:
iotwin-network:
ipv4_address: 172.20.0.50
#haproxy:
# image: haproxy:alpine
postgres:
restart: always
image: 'postgres'
container_name: pgsql_keycloak
hostname: pgsql_keycloak
#expose:
# - "5432"
#ports:
# - '127.0.0.1:5432:5432'
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
environment:
POSTGRES_DB: keycloak
POSTGRES_USER: keycloak
POSTGRES_PASSWORD: admin
networks:
iotwin-network:
ipv4_address: 172.20.0.55
keycloak:
restart: always
#image: 'quay.io/keycloak/keycloak:latest'
image: 'jboss/keycloak:latest'
container_name: keycloak
hostname: keycloak
environment:
DB_VENDOR: POSTGRES
DB_ADDR: postgres
DB_DATABASE: keycloak
DB_USER: keycloak
DB_SCHEMA: public
DB_PASSWORD: admin
#KEYCLOAK_USER: admin
#KEYCLOAK_PASSWORD: admin
#JDBC_PARAMS: "ssl=true"
ports:
- 8080:8080
depends_on:
- postgres
networks:
iotwin-network:
ipv4_address: 172.20.0.60