docker-compose.yml 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  1. #
  2. # Copyright © 2016-2023 The Thingsboard Authors
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. #
  16. version: '3.0'
  17. services:
  18. zookeeper:
  19. restart: always
  20. image: "zookeeper:3.8.0"
  21. ports:
  22. - "2181"
  23. environment:
  24. ZOO_MY_ID: 1
  25. ZOO_SERVERS: server.1=zookeeper:2888:3888;zookeeper:2181
  26. ZOO_ADMINSERVER_ENABLED: "false"
  27. tb-js-executor:
  28. restart: always
  29. image: "${DOCKER_REPO}/${JS_EXECUTOR_DOCKER_NAME}:${TB_VERSION}"
  30. deploy:
  31. replicas: 10
  32. env_file:
  33. - tb-js-executor.env
  34. tb-core1:
  35. restart: always
  36. image: "${DOCKER_REPO}/${TB_NODE_DOCKER_NAME}:${TB_VERSION}"
  37. ports:
  38. - "8080"
  39. - "7070"
  40. logging:
  41. driver: "json-file"
  42. options:
  43. max-size: "200m"
  44. max-file: "30"
  45. environment:
  46. TB_SERVICE_ID: tb-core1
  47. TB_SERVICE_TYPE: tb-core
  48. EDGES_ENABLED: "true"
  49. JAVA_OPTS: "${JAVA_OPTS}"
  50. env_file:
  51. - tb-node.env
  52. volumes:
  53. - ./tb-node/conf:/config
  54. - ./tb-node/log:/var/log/thingsboard
  55. depends_on:
  56. - zookeeper
  57. - tb-js-executor
  58. - tb-rule-engine1
  59. - tb-rule-engine2
  60. tb-core2:
  61. restart: always
  62. image: "${DOCKER_REPO}/${TB_NODE_DOCKER_NAME}:${TB_VERSION}"
  63. ports:
  64. - "8080"
  65. - "7070"
  66. logging:
  67. driver: "json-file"
  68. options:
  69. max-size: "200m"
  70. max-file: "30"
  71. environment:
  72. TB_SERVICE_ID: tb-core2
  73. TB_SERVICE_TYPE: tb-core
  74. EDGES_ENABLED: "true"
  75. JAVA_OPTS: "${JAVA_OPTS}"
  76. env_file:
  77. - tb-node.env
  78. volumes:
  79. - ./tb-node/conf:/config
  80. - ./tb-node/log:/var/log/thingsboard
  81. depends_on:
  82. - zookeeper
  83. - tb-js-executor
  84. - tb-rule-engine1
  85. - tb-rule-engine2
  86. tb-rule-engine1:
  87. restart: always
  88. image: "${DOCKER_REPO}/${TB_NODE_DOCKER_NAME}:${TB_VERSION}"
  89. ports:
  90. - "8080"
  91. logging:
  92. driver: "json-file"
  93. options:
  94. max-size: "200m"
  95. max-file: "30"
  96. environment:
  97. TB_SERVICE_ID: tb-rule-engine1
  98. TB_SERVICE_TYPE: tb-rule-engine
  99. JAVA_OPTS: "${JAVA_OPTS}"
  100. env_file:
  101. - tb-node.env
  102. volumes:
  103. - ./tb-node/conf:/config
  104. - ./tb-node/log:/var/log/thingsboard
  105. depends_on:
  106. - zookeeper
  107. - tb-js-executor
  108. tb-rule-engine2:
  109. restart: always
  110. image: "${DOCKER_REPO}/${TB_NODE_DOCKER_NAME}:${TB_VERSION}"
  111. ports:
  112. - "8080"
  113. logging:
  114. driver: "json-file"
  115. options:
  116. max-size: "200m"
  117. max-file: "30"
  118. environment:
  119. TB_SERVICE_ID: tb-rule-engine2
  120. TB_SERVICE_TYPE: tb-rule-engine
  121. JAVA_OPTS: "${JAVA_OPTS}"
  122. env_file:
  123. - tb-node.env
  124. volumes:
  125. - ./tb-node/conf:/config
  126. - ./tb-node/log:/var/log/thingsboard
  127. depends_on:
  128. - zookeeper
  129. - tb-js-executor
  130. tb-mqtt-transport1:
  131. restart: always
  132. image: "${DOCKER_REPO}/${MQTT_TRANSPORT_DOCKER_NAME}:${TB_VERSION}"
  133. ports:
  134. - "1883"
  135. environment:
  136. TB_SERVICE_ID: tb-mqtt-transport1
  137. JAVA_OPTS: "${JAVA_OPTS}"
  138. env_file:
  139. - tb-mqtt-transport.env
  140. volumes:
  141. - ./tb-transports/mqtt/conf:/config
  142. - ./tb-transports/mqtt/log:/var/log/tb-mqtt-transport
  143. depends_on:
  144. - zookeeper
  145. - tb-core1
  146. - tb-core2
  147. tb-mqtt-transport2:
  148. restart: always
  149. image: "${DOCKER_REPO}/${MQTT_TRANSPORT_DOCKER_NAME}:${TB_VERSION}"
  150. ports:
  151. - "1883"
  152. environment:
  153. TB_SERVICE_ID: tb-mqtt-transport2
  154. JAVA_OPTS: "${JAVA_OPTS}"
  155. env_file:
  156. - tb-mqtt-transport.env
  157. volumes:
  158. - ./tb-transports/mqtt/conf:/config
  159. - ./tb-transports/mqtt/log:/var/log/tb-mqtt-transport
  160. depends_on:
  161. - zookeeper
  162. - tb-core1
  163. - tb-core2
  164. tb-http-transport1:
  165. restart: always
  166. image: "${DOCKER_REPO}/${HTTP_TRANSPORT_DOCKER_NAME}:${TB_VERSION}"
  167. ports:
  168. - "8081"
  169. environment:
  170. TB_SERVICE_ID: tb-http-transport1
  171. JAVA_OPTS: "${JAVA_OPTS}"
  172. env_file:
  173. - tb-http-transport.env
  174. volumes:
  175. - ./tb-transports/http/conf:/config
  176. - ./tb-transports/http/log:/var/log/tb-http-transport
  177. depends_on:
  178. - zookeeper
  179. - tb-core1
  180. - tb-core2
  181. tb-http-transport2:
  182. restart: always
  183. image: "${DOCKER_REPO}/${HTTP_TRANSPORT_DOCKER_NAME}:${TB_VERSION}"
  184. ports:
  185. - "8081"
  186. environment:
  187. TB_SERVICE_ID: tb-http-transport2
  188. JAVA_OPTS: "${JAVA_OPTS}"
  189. env_file:
  190. - tb-http-transport.env
  191. volumes:
  192. - ./tb-transports/http/conf:/config
  193. - ./tb-transports/http/log:/var/log/tb-http-transport
  194. depends_on:
  195. - zookeeper
  196. - tb-core1
  197. - tb-core2
  198. tb-coap-transport:
  199. restart: always
  200. image: "${DOCKER_REPO}/${COAP_TRANSPORT_DOCKER_NAME}:${TB_VERSION}"
  201. ports:
  202. - "5683:5683/udp"
  203. environment:
  204. TB_SERVICE_ID: tb-coap-transport
  205. JAVA_OPTS: "${JAVA_OPTS}"
  206. env_file:
  207. - tb-coap-transport.env
  208. volumes:
  209. - ./tb-transports/coap/conf:/config
  210. - ./tb-transports/coap/log:/var/log/tb-coap-transport
  211. depends_on:
  212. - zookeeper
  213. - tb-core1
  214. - tb-core2
  215. tb-lwm2m-transport:
  216. restart: always
  217. image: "${DOCKER_REPO}/${LWM2M_TRANSPORT_DOCKER_NAME}:${TB_VERSION}"
  218. ports:
  219. - "5685:5685/udp"
  220. environment:
  221. TB_SERVICE_ID: tb-lwm2m-transport
  222. JAVA_OPTS: "${JAVA_OPTS}"
  223. env_file:
  224. - tb-lwm2m-transport.env
  225. volumes:
  226. - ./tb-transports/lwm2m/conf:/config
  227. - ./tb-transports/lwm2m/log:/var/log/tb-lwm2m-transport
  228. depends_on:
  229. - zookeeper
  230. - tb-core1
  231. - tb-core2
  232. tb-snmp-transport:
  233. restart: always
  234. image: "${DOCKER_REPO}/${SNMP_TRANSPORT_DOCKER_NAME}:${TB_VERSION}"
  235. ports:
  236. - "1620:1620/udp"
  237. environment:
  238. TB_SERVICE_ID: tb-snmp-transport
  239. JAVA_OPTS: "${JAVA_OPTS}"
  240. env_file:
  241. - tb-snmp-transport.env
  242. volumes:
  243. - ./tb-transports/snmp/conf:/config
  244. - ./tb-transports/snmp/log:/var/log/tb-snmp-transport
  245. depends_on:
  246. - zookeeper
  247. - tb-core1
  248. - tb-core2
  249. tb-web-ui1:
  250. restart: always
  251. image: "${DOCKER_REPO}/${WEB_UI_DOCKER_NAME}:${TB_VERSION}"
  252. ports:
  253. - "8080"
  254. env_file:
  255. - tb-web-ui.env
  256. tb-web-ui2:
  257. restart: always
  258. image: "${DOCKER_REPO}/${WEB_UI_DOCKER_NAME}:${TB_VERSION}"
  259. ports:
  260. - "8080"
  261. env_file:
  262. - tb-web-ui.env
  263. tb-vc-executor1:
  264. restart: always
  265. image: "${DOCKER_REPO}/${TB_VC_EXECUTOR_DOCKER_NAME}:${TB_VERSION}"
  266. ports:
  267. - "8081"
  268. environment:
  269. TB_SERVICE_ID: tb-vc-executor1
  270. JAVA_OPTS: "${JAVA_OPTS}"
  271. env_file:
  272. - tb-vc-executor.env
  273. volumes:
  274. - ./tb-vc-executor/conf:/config
  275. - ./tb-vc-executor/log:/var/log/tb-vc-executor
  276. depends_on:
  277. - zookeeper
  278. - tb-core1
  279. - tb-core2
  280. tb-vc-executor2:
  281. restart: always
  282. image: "${DOCKER_REPO}/${TB_VC_EXECUTOR_DOCKER_NAME}:${TB_VERSION}"
  283. ports:
  284. - "8081"
  285. environment:
  286. TB_SERVICE_ID: tb-vc-executor2
  287. JAVA_OPTS: "${JAVA_OPTS}"
  288. env_file:
  289. - tb-vc-executor.env
  290. volumes:
  291. - ./tb-vc-executor/conf:/config
  292. - ./tb-vc-executor/log:/var/log/tb-vc-executor
  293. depends_on:
  294. - zookeeper
  295. - tb-core1
  296. - tb-core2
  297. haproxy:
  298. restart: always
  299. container_name: "${LOAD_BALANCER_NAME}"
  300. image: thingsboard/haproxy-certbot:1.3.0
  301. volumes:
  302. - ./haproxy/config:/config
  303. - ./haproxy/letsencrypt:/etc/letsencrypt
  304. - ./haproxy/certs.d:/usr/local/etc/haproxy/certs.d
  305. ports:
  306. - "80:80"
  307. - "443:443"
  308. - "1883:1883"
  309. - "7070:7070"
  310. - "9999:9999"
  311. cap_add:
  312. - NET_ADMIN
  313. environment:
  314. HTTP_PORT: 80
  315. HTTPS_PORT: 443
  316. MQTT_PORT: 1883
  317. EDGES_RPC_PORT: 7070
  318. FORCE_HTTPS_REDIRECT: "false"
  319. links:
  320. - tb-core1
  321. - tb-core2
  322. - tb-web-ui1
  323. - tb-web-ui2
  324. - tb-mqtt-transport1
  325. - tb-mqtt-transport2
  326. - tb-http-transport1
  327. - tb-http-transport2