docker-compose.yml 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. version: '3'
  2. services:
  3. ####################################################################################################
  4. ###=================================== 以下为中间件模块 =========================================###
  5. ####################################################################################################
  6. nacos:
  7. image: nacos/nacos-server:v2.3.1
  8. hostname: "nacos-standalone"
  9. environment:
  10. - NACOS_AUTH_ENABLE=true
  11. - NACOS_AUTH_CACHE_ENABLE=true
  12. - NACOS_AUTH_IDENTITY_KEY=nacos
  13. - NACOS_AUTH_IDENTITY_VALUE=nacos
  14. - NACOS_AUTH_TOKEN= # 请阅读官方文档了解规则后替换为自己的token:https://nacos.io/zh-cn/docs/v2/guide/user/auth.html
  15. - MODE=standalone
  16. - TZ=Asia/Shanghai
  17. volumes:
  18. - /docker/nacos/standalone-logs/:/home/nacos/logs
  19. - /docker/nacos/conf/application.properties:/home/nacos/conf/application.properties
  20. ports:
  21. - 8848:8848
  22. - 9848:9848
  23. - 9849:9849
  24. networks:
  25. blade_net:
  26. ipv4_address: 172.30.0.48
  27. sentinel:
  28. image: bladex/sentinel-dashboard:1.8.6
  29. hostname: "sentinel"
  30. environment:
  31. - TZ=Asia/Shanghai
  32. ports:
  33. - 8858:8858
  34. restart: on-failure
  35. networks:
  36. blade_net:
  37. ipv4_address: 172.30.0.58
  38. seata-server:
  39. image: seataio/seata-server:1.6.1
  40. hostname: "seata-server"
  41. ports:
  42. - 8091:8091
  43. environment:
  44. - TZ=Asia/Shanghai
  45. - SEATA_PORT=8091
  46. - STORE_MODE=file
  47. networks:
  48. blade_net:
  49. ipv4_address: 172.30.0.68
  50. blade-nginx:
  51. image: nginx:stable-alpine-perl
  52. hostname: "blade-nginx"
  53. environment:
  54. - TZ=Asia/Shanghai
  55. ports:
  56. - 88:88
  57. volumes:
  58. - /docker/nginx/api/nginx.conf:/etc/nginx/nginx.conf
  59. privileged: true
  60. restart: always
  61. networks:
  62. - blade_net
  63. web-nginx:
  64. image: nginx:stable-alpine-perl
  65. hostname: "web-nginx"
  66. environment:
  67. - TZ=Asia/Shanghai
  68. ports:
  69. - 8000:8000
  70. volumes:
  71. - /docker/nginx/web/html:/usr/share/nginx/html
  72. - /docker/nginx/web/nginx.conf:/etc/nginx/nginx.conf
  73. privileged: true
  74. restart: always
  75. networks:
  76. - blade_net
  77. blade-redis:
  78. image: redis:5.0.8-alpine
  79. hostname: "blade-redis"
  80. environment:
  81. - TZ=Asia/Shanghai
  82. ports:
  83. - 3379:6379
  84. volumes:
  85. - /docker/redis/data:/data
  86. command: "redis-server --appendonly yes"
  87. privileged: true
  88. restart: always
  89. networks:
  90. - blade_net
  91. ##powerjob.network.external.address可配置为外部宿主机地址,更详细见:https://www.yuque.com/powerjob/guidence/deploy_server
  92. powerjob-server:
  93. container_name: powerjob-server
  94. image: powerjob/powerjob-server:4.3.6
  95. restart: always
  96. environment:
  97. JVMOPTIONS: "-Xmx512m -Dpowerjob.network.external.address=172.30.0.70 -Dpowerjob.network.external.port.http=10010 -Dpowerjob.network.external.port.akka=10086"
  98. PARAMS: "--spring.datasource.core.jdbc-url=jdbc:mysql://mysql服务ip:端口/powerjob-product?useUnicode=true&characterEncoding=UTF-8&useSSL=false --spring.datasource.core.username=mysql账号名 --spring.datasource.core.password=mysql密码 --oms.mongodb.enable=false"
  99. ports:
  100. - 7700:7700
  101. - 10086:10086
  102. - 10010:10010
  103. networks:
  104. blade_net:
  105. ipv4_address: 172.30.0.70
  106. ####################################################################################################
  107. ###================================= 以下为BladeX服务模块 =======================================###
  108. ####################################################################################################
  109. blade-admin:
  110. image: "${REGISTER}/blade-admin:${TAG}"
  111. environment:
  112. - TZ=Asia/Shanghai
  113. ports:
  114. - 7002:7002
  115. privileged: true
  116. restart: always
  117. networks:
  118. blade_net:
  119. ipv4_address: 172.30.0.72
  120. blade-swagger:
  121. image: "${REGISTER}/blade-swagger:${TAG}"
  122. environment:
  123. - TZ=Asia/Shanghai
  124. ports:
  125. - 18000:18000
  126. privileged: true
  127. restart: always
  128. networks:
  129. - blade_net
  130. blade-gateway1:
  131. image: "${REGISTER}/blade-gateway:${TAG}"
  132. environment:
  133. - TZ=Asia/Shanghai
  134. privileged: true
  135. restart: always
  136. networks:
  137. blade_net:
  138. ipv4_address: 172.30.0.81
  139. blade-gateway2:
  140. image: "${REGISTER}/blade-gateway:${TAG}"
  141. environment:
  142. - TZ=Asia/Shanghai
  143. privileged: true
  144. restart: always
  145. networks:
  146. blade_net:
  147. ipv4_address: 172.30.0.82
  148. blade-auth1:
  149. image: "${REGISTER}/blade-auth:${TAG}"
  150. environment:
  151. - TZ=Asia/Shanghai
  152. privileged: true
  153. restart: always
  154. networks:
  155. blade_net:
  156. ipv4_address: 172.30.0.91
  157. blade-auth2:
  158. image: "${REGISTER}/blade-auth:${TAG}"
  159. environment:
  160. - TZ=Asia/Shanghai
  161. privileged: true
  162. restart: always
  163. networks:
  164. blade_net:
  165. ipv4_address: 172.30.0.92
  166. blade-report:
  167. image: "${REGISTER}/blade-report:${TAG}"
  168. environment:
  169. - TZ=Asia/Shanghai
  170. privileged: true
  171. restart: always
  172. ports:
  173. - 8108:8108
  174. networks:
  175. blade_net:
  176. ipv4_address: 172.30.0.98
  177. blade-log:
  178. image: "${REGISTER}/blade-log:${TAG}"
  179. environment:
  180. - TZ=Asia/Shanghai
  181. privileged: true
  182. restart: always
  183. networks:
  184. - blade_net
  185. blade-desk:
  186. image: "${REGISTER}/blade-desk:${TAG}"
  187. environment:
  188. - TZ=Asia/Shanghai
  189. privileged: true
  190. restart: always
  191. networks:
  192. - blade_net
  193. blade-system:
  194. image: "${REGISTER}/blade-system:${TAG}"
  195. environment:
  196. - TZ=Asia/Shanghai
  197. privileged: true
  198. restart: always
  199. networks:
  200. - blade_net
  201. blade-flow:
  202. image: "${REGISTER}/blade-flow:${TAG}"
  203. environment:
  204. - TZ=Asia/Shanghai
  205. privileged: true
  206. restart: always
  207. networks:
  208. - blade_net
  209. blade-resource:
  210. image: "${REGISTER}/blade-resource:${TAG}"
  211. environment:
  212. - TZ=Asia/Shanghai
  213. privileged: true
  214. restart: always
  215. networks:
  216. - blade_net
  217. blade-job:
  218. image: "${REGISTER}/blade-job:${TAG}"
  219. environment:
  220. - TZ=Asia/Shanghai
  221. privileged: true
  222. restart: always
  223. networks:
  224. - blade_net
  225. ####################################################################################################
  226. ###=============================== 以下为Prometheus监控模块 =====================================###
  227. ####################################################################################################
  228. prometheus:
  229. image: prom/prometheus:v2.24.1
  230. hostname: "prometheus"
  231. environment:
  232. - TZ=Asia/Shanghai
  233. ports:
  234. - 9090:9090
  235. volumes:
  236. - /docker/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
  237. - /docker/prometheus/rules:/etc/prometheus/rules
  238. command: "--config.file=/etc/prometheus/prometheus.yml --web.enable-lifecycle"
  239. privileged: true
  240. restart: always
  241. networks:
  242. blade_net:
  243. ipv4_address: 172.30.0.90
  244. node-exporter:
  245. image: prom/node-exporter:v1.0.1
  246. hostname: "node-exporter"
  247. environment:
  248. - TZ=Asia/Shanghai
  249. ports:
  250. - 9190:9100
  251. privileged: true
  252. restart: always
  253. networks:
  254. blade_net:
  255. ipv4_address: 172.30.0.93
  256. mysqld-exporter:
  257. image: prom/mysqld-exporter:v0.12.1
  258. hostname: "mysqld-exporter"
  259. environment:
  260. - TZ=Asia/Shanghai
  261. # 需要先在mysql服务执行如下语句
  262. # =====================================================================================
  263. # === CREATE USER 'exporter'@'mysql服务ip' IDENTIFIED BY '密码'; ===
  264. # === GRANT PROCESS, REPLICATION CLIENT, SELECT ON *.* TO 'exporter'@'mysql服务ip'; ===
  265. # === flush privileges; ===
  266. # =====================================================================================
  267. - DATA_SOURCE_NAME=exporter:密码@(mysql服务ip:mysql服务端口)/
  268. ports:
  269. - 9104:9104
  270. privileged: true
  271. restart: always
  272. networks:
  273. blade_net:
  274. ipv4_address: 172.30.0.94
  275. cadvisor:
  276. image: google/cadvisor:v0.33.0
  277. hostname: "cadvisor"
  278. environment:
  279. - TZ=Asia/Shanghai
  280. ports:
  281. - 18080:8080
  282. volumes:
  283. - /:/rootfs:ro
  284. - /var/run:/var/run:rw
  285. - /sys:/sys:ro
  286. - /var/lib/docker/:/var/lib/docker:ro
  287. - /dev/disk/:/dev/disk:ro
  288. command: "detach=true"
  289. privileged: true
  290. restart: always
  291. networks:
  292. blade_net:
  293. ipv4_address: 172.30.0.180
  294. grafana:
  295. image: grafana/grafana:7.3.7
  296. hostname: "grafana"
  297. environment:
  298. - TZ=Asia/Shanghai
  299. - GF_SERVER_ROOT_URL=https://grafana.bladex.vip
  300. - GF_SECURITY_ADMIN_PASSWORD=1qaz@WSX
  301. ports:
  302. - 3000:3000
  303. volumes:
  304. - /docker/grafana/grafana.ini:/etc/grafana/grafana.ini
  305. - /docker/grafana:/var/lib/grafana
  306. privileged: true
  307. restart: always
  308. networks:
  309. blade_net:
  310. ipv4_address: 172.30.0.30
  311. alertmanager:
  312. image: prom/alertmanager:v0.21.0
  313. hostname: "alertmanager"
  314. environment:
  315. - TZ=Asia/Shanghai
  316. ports:
  317. - 9093:9093
  318. volumes:
  319. - /docker/alertmanager/alertmanager.yml:/etc/alertmanager/alertmanager.yml
  320. - /docker/alertmanager/data:/etc/alertmanager/data
  321. - /docker/alertmanager/templates:/etc/alertmanager/templates
  322. command: "--config.file=/etc/alertmanager/alertmanager.yml --storage.path=/etc/alertmanager/data"
  323. privileged: true
  324. restart: always
  325. networks:
  326. blade_net:
  327. ipv4_address: 172.30.0.99
  328. webhook-dingtalk:
  329. image: timonwong/prometheus-webhook-dingtalk:v1.4.0
  330. hostname: "webhook-dingtalk"
  331. environment:
  332. - TZ=Asia/Shanghai
  333. ports:
  334. - 8060:8060
  335. command: "ding.profile=webhook_robot=https://oapi.dingtalk.com/robot/send?access_token=xxxxx"
  336. privileged: true
  337. restart: always
  338. networks:
  339. blade_net:
  340. ipv4_address: 172.30.0.96
  341. networks:
  342. blade_net:
  343. driver: bridge
  344. ipam:
  345. config:
  346. - subnet: 172.30.0.0/16