docker-compose-tnb.yml 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. services:
  2. tnbgateway:
  3. image: registry.cn-chengdu.aliyuncs.com/tnb028/tnbgateway
  4. container_name: tnbgateway
  5. restart: always
  6. network_mode: host
  7. environment:
  8. - SPRING_CLOUD_NACOS_CONFIG_SERVER_ADDR=127.0.0.1:8848
  9. - SPRING_CLOUD_NACOS_CONFIG_USERNAME=nacos
  10. - SPRING_CLOUD_NACOS_CONFIG_PASSWORD=Test_123456
  11. # 告诉 JVM 自动根据容器限制来计算堆内存(重要!)
  12. - JAVA_TOOL_OPTIONS=-XX:+UseContainerSupport -XX:MaxRAMPercentage=75.0
  13. volumes:
  14. - /etc/localtime:/etc/localtime:ro
  15. deploy:
  16. resources:
  17. limits:
  18. cpus: '2.0' # 最多使用 2 核 CPU
  19. memory: 2048M # 最多使用 2G 内存
  20. reservations:
  21. cpus: '0.5' # 宿主机最少为该容器保留 0.5 核
  22. memory: 1024M # 宿主机最少为该容器保留 1G 内存
  23. logging:
  24. driver: "json-file"
  25. options:
  26. max-size: "10m"
  27. max-file: "1"
  28. tnbauth:
  29. image: registry.cn-chengdu.aliyuncs.com/tnb028/tnbauth
  30. container_name: tnbauth
  31. restart: always
  32. network_mode: host
  33. environment:
  34. - SPRING_CLOUD_NACOS_CONFIG_SERVER_ADDR=127.0.0.1:8848
  35. - SPRING_CLOUD_NACOS_CONFIG_USERNAME=nacos
  36. - SPRING_CLOUD_NACOS_CONFIG_PASSWORD=Test_123456
  37. # 告诉 JVM 自动根据容器限制来计算堆内存(重要!)
  38. - JAVA_TOOL_OPTIONS=-XX:+UseContainerSupport -XX:MaxRAMPercentage=75.0
  39. volumes:
  40. - /etc/localtime:/etc/localtime:ro
  41. deploy:
  42. resources:
  43. limits:
  44. cpus: '2.0' # 最多使用 2 核 CPU
  45. memory: 2048M # 最多使用 2G 内存
  46. reservations:
  47. cpus: '0.5' # 宿主机最少为该容器保留 0.5 核
  48. memory: 1024M # 宿主机最少为该容器保留 1G 内存
  49. logging:
  50. driver: "json-file"
  51. options:
  52. max-size: "10m"
  53. max-file: "1"
  54. tnbmessage:
  55. image: registry.cn-chengdu.aliyuncs.com/tnb028/tnbmessage
  56. container_name: tnbmessage
  57. restart: always
  58. network_mode: host
  59. environment:
  60. - SPRING_CLOUD_NACOS_CONFIG_SERVER_ADDR=127.0.0.1:8848
  61. - SPRING_CLOUD_NACOS_CONFIG_USERNAME=nacos
  62. - SPRING_CLOUD_NACOS_CONFIG_PASSWORD=Test_123456
  63. # 告诉 JVM 自动根据容器限制来计算堆内存(重要!)
  64. - JAVA_TOOL_OPTIONS=-XX:+UseContainerSupport -XX:MaxRAMPercentage=75.0
  65. volumes:
  66. - /etc/localtime:/etc/localtime:ro
  67. deploy:
  68. resources:
  69. limits:
  70. cpus: '2.0' # 最多使用 2 核 CPU
  71. memory: 2048M # 最多使用 2G 内存
  72. reservations:
  73. cpus: '0.5' # 宿主机最少为该容器保留 0.5 核
  74. memory: 1024M # 宿主机最少为该容器保留 1G 内存
  75. logging:
  76. driver: "json-file"
  77. options:
  78. max-size: "10m"
  79. max-file: "1"
  80. tnbfile:
  81. image: registry.cn-chengdu.aliyuncs.com/tnb028/tnbfile
  82. container_name: tnbfile
  83. restart: always
  84. network_mode: host
  85. environment:
  86. - SPRING_CLOUD_NACOS_CONFIG_SERVER_ADDR=127.0.0.1:8848
  87. - SPRING_CLOUD_NACOS_CONFIG_USERNAME=nacos
  88. - SPRING_CLOUD_NACOS_CONFIG_PASSWORD=Test_123456
  89. # 告诉 JVM 自动根据容器限制来计算堆内存(重要!)
  90. - JAVA_TOOL_OPTIONS=-XX:+UseContainerSupport -XX:MaxRAMPercentage=75.0
  91. volumes:
  92. - /etc/localtime:/etc/localtime:ro
  93. deploy:
  94. resources:
  95. limits:
  96. cpus: '2.0' # 最多使用 2 核 CPU
  97. memory: 2048M # 最多使用 2G 内存
  98. reservations:
  99. cpus: '0.5' # 宿主机最少为该容器保留 0.5 核
  100. memory: 1024M # 宿主机最少为该容器保留 1G 内存
  101. logging:
  102. driver: "json-file"
  103. options:
  104. max-size: "10m"
  105. max-file: "1"
  106. tnbuser:
  107. image: registry.cn-chengdu.aliyuncs.com/tnb028/tnbuser
  108. container_name: tnbuser
  109. restart: always
  110. network_mode: host
  111. environment:
  112. - SPRING_CLOUD_NACOS_CONFIG_SERVER_ADDR=127.0.0.1:8848
  113. - SPRING_CLOUD_NACOS_CONFIG_USERNAME=nacos
  114. - SPRING_CLOUD_NACOS_CONFIG_PASSWORD=Test_123456
  115. # 告诉 JVM 自动根据容器限制来计算堆内存(重要!)
  116. - JAVA_TOOL_OPTIONS=-XX:+UseContainerSupport -XX:MaxRAMPercentage=75.0
  117. volumes:
  118. - /etc/localtime:/etc/localtime:ro
  119. deploy:
  120. resources:
  121. limits:
  122. cpus: '2.0' # 最多使用 2 核 CPU
  123. memory: 2048M # 最多使用 2G 内存
  124. reservations:
  125. cpus: '0.5' # 宿主机最少为该容器保留 0.5 核
  126. memory: 1024M # 宿主机最少为该容器保留 1G 内存
  127. logging:
  128. driver: "json-file"
  129. options:
  130. max-size: "10m"
  131. max-file: "1"
  132. tnbcontent:
  133. image: registry.cn-chengdu.aliyuncs.com/tnb028/tnbcontent
  134. container_name: tnbcontent
  135. restart: always
  136. network_mode: host
  137. environment:
  138. - SPRING_CLOUD_NACOS_CONFIG_SERVER_ADDR=127.0.0.1:8848
  139. - SPRING_CLOUD_NACOS_CONFIG_USERNAME=nacos
  140. - SPRING_CLOUD_NACOS_CONFIG_PASSWORD=Test_123456
  141. # 告诉 JVM 自动根据容器限制来计算堆内存(重要!)
  142. - JAVA_TOOL_OPTIONS=-XX:+UseContainerSupport -XX:MaxRAMPercentage=75.0
  143. volumes:
  144. - /etc/localtime:/etc/localtime:ro
  145. deploy:
  146. resources:
  147. limits:
  148. cpus: '2.0' # 最多使用 2 核 CPU
  149. memory: 2048M # 最多使用 2G 内存
  150. reservations:
  151. cpus: '0.5' # 宿主机最少为该容器保留 0.5 核
  152. memory: 1024M # 宿主机最少为该容器保留 1G 内存
  153. logging:
  154. driver: "json-file"
  155. options:
  156. max-size: "10m"
  157. max-file: "1"
  158. tnbsearch:
  159. image: registry.cn-chengdu.aliyuncs.com/tnb028/tnbsearch
  160. container_name: tnbsearch
  161. restart: always
  162. network_mode: host
  163. environment:
  164. - SPRING_CLOUD_NACOS_CONFIG_SERVER_ADDR=127.0.0.1:8848
  165. - SPRING_CLOUD_NACOS_CONFIG_USERNAME=nacos
  166. - SPRING_CLOUD_NACOS_CONFIG_PASSWORD=Test_123456
  167. # 告诉 JVM 自动根据容器限制来计算堆内存(重要!)
  168. - JAVA_TOOL_OPTIONS=-XX:+UseContainerSupport -XX:MaxRAMPercentage=75.0
  169. volumes:
  170. - /etc/localtime:/etc/localtime:ro
  171. deploy:
  172. resources:
  173. limits:
  174. cpus: '2.0' # 最多使用 2 核 CPU
  175. memory: 2048M # 最多使用 2G 内存
  176. reservations:
  177. cpus: '0.5' # 宿主机最少为该容器保留 0.5 核
  178. memory: 1024M # 宿主机最少为该容器保留 1G 内存
  179. logging:
  180. driver: "json-file"
  181. options:
  182. max-size: "10m"
  183. max-file: "1"
  184. tnbapp:
  185. image: registry.cn-chengdu.aliyuncs.com/tnb028/tnbapp
  186. container_name: tnbapp
  187. restart: always
  188. network_mode: host
  189. environment:
  190. - APP_OPS_ROOT=/opt/data/devops_data
  191. volumes:
  192. - /etc/localtime:/etc/localtime:ro
  193. deploy:
  194. resources:
  195. limits:
  196. cpus: '1.0'
  197. memory: 128MB
  198. reservations:
  199. memory: 64MB
  200. logging:
  201. driver: "json-file"
  202. options:
  203. max-size: "10m"
  204. max-file: "1"