docker-compose-env.yml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. version: '3.5'
  2. ######## 项目依赖的环境,启动项目之前要先启动此环境 #######
  3. services:
  4. #jaeger链路追踪
  5. jaeger:
  6. image: jaegertracing/all-in-one:latest
  7. container_name: jaeger
  8. restart: always
  9. ports:
  10. - "5775:5775/udp"
  11. - "6831:6831/udp"
  12. - "6832:6832/udp"
  13. - "5778:5778"
  14. - "16686:16686"
  15. - "14268:14268"
  16. - "9411:9411"
  17. environment:
  18. - "SPAN_STORAGE_TYPE=elasticsearch"
  19. - "ES_SERVER_URLS=http://elasticsearch:9200"
  20. - "LOG_LEVEL=debug"
  21. networks:
  22. - ylink_net
  23. # #搜集kafka业务日志、存储prometheus监控数据
  24. elasticsearch:
  25. image: docker.elastic.co/elasticsearch/elasticsearch:7.13.4
  26. container_name: elasticsearch
  27. user: root
  28. environment:
  29. - "discovery.type=single-node"
  30. - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
  31. - "TZ=Asia/Shanghai"
  32. volumes:
  33. - "/data/docker_mount/elasticsearch/data:/usr/share/elasticsearch/data"
  34. restart: always
  35. ports:
  36. - "9200:9200"
  37. - "9300:9300"
  38. networks:
  39. - ylink_net
  40. #查看elasticsearch数据
  41. kibana:
  42. image: docker.elastic.co/kibana/kibana:7.13.4
  43. container_name: kibana
  44. environment:
  45. - "elasticsearch.hosts=http://elasticsearch:9200"
  46. - "TZ=Asia/Shanghai"
  47. restart: always
  48. networks:
  49. - ylink_net
  50. ports:
  51. - "5601:5601"
  52. depends_on:
  53. - elasticsearch
  54. #消费kafka中filebeat收集的数据输出到es
  55. go-stash:
  56. image: kevinwan/go-stash:1.0 # if you "macOs intel" or "linux amd"
  57. # image: kevinwan/go-stash:1.0-arm64 # if you "macOs m1" or "linux arm"
  58. container_name: go-stash
  59. environment:
  60. # 时区上海
  61. TZ: "Asia/Shanghai"
  62. user: root
  63. restart: always
  64. volumes:
  65. - "/data/docker_mount/go-stash/etc:/app/etc"
  66. networks:
  67. - ylink_net
  68. depends_on:
  69. - elasticsearch
  70. - kafka
  71. #收集业务数据
  72. filebeat:
  73. image: elastic/filebeat:7.13.4
  74. container_name: filebeat
  75. environment:
  76. # 时区上海
  77. TZ: "Asia/Shanghai"
  78. user: root
  79. restart: always
  80. entrypoint: "filebeat -e -strict.perms=false" #解决配置文件权限问题
  81. volumes:
  82. - "/data/docker_mount/filebeat/conf/filebeat.yml:/usr/share/filebeat/filebeat.yml"
  83. # 此处需指定docker的containers目录,取决于你docker的配置
  84. # 如snap安装的docker,则为/var/snap/docker/common/var-lib-docker/containers
  85. # - /var/snap/docker/common/var-lib-docker/containers:/var/lib/docker/containers
  86. - "/var/lib/docker/containers:/var/lib/docker/containers"
  87. networks:
  88. - ylink_net
  89. depends_on:
  90. - kafka
  91. #zookeeper是kafka的依赖
  92. zookeeper:
  93. image: wurstmeister/zookeeper
  94. container_name: zookeeper
  95. environment:
  96. # 时区上海
  97. TZ: "Asia/Shanghai"
  98. restart: always
  99. ports:
  100. - "2181:2181"
  101. networks:
  102. - ylink_net
  103. #消息队列
  104. kafka:
  105. image: wurstmeister/kafka
  106. container_name: kafka
  107. ports:
  108. - "9092:9092"
  109. environment:
  110. - "KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092"
  111. - "KAFKA_LISTENERS=PLAINTEXT://0.0.0.0:9092 "
  112. - "KAFKA_ADVERTISED_HOST_NAME=kafka"
  113. - "KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181"
  114. - "KAFKA_AUTO_CREATE_TOPICS_ENABLE=false"
  115. - "TZ=Asia/Shanghai"
  116. - "KAFKA_BROKER_ID=0"
  117. - "KAFKA_ADVERTISED_PORT=9092"
  118. restart: always
  119. volumes:
  120. - "/var/run/docker.sock:/var/run/docker.sock"
  121. networks:
  122. - ylink_net
  123. depends_on:
  124. - zookeeper
  125. kafka-ui:
  126. image: provectuslabs/kafka-ui
  127. container_name: kafka-ui
  128. ports:
  129. - "8080:8080"
  130. restart: always
  131. environment:
  132. - "KAFKA_CLUSTERS_0_NAME=local"
  133. - "KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS=kafka:9092"
  134. - "KAFKA_CLUSTERS_0_ZOOKEEPER=zookeeper:2181"
  135. networks:
  136. - ylink_net
  137. #redis容器
  138. redis:
  139. image: redis:6.2.5
  140. container_name: redis
  141. ports:
  142. - "6379:6379"
  143. environment:
  144. - "TZ=Asia/Shanghai"
  145. volumes:
  146. # 数据文件
  147. - "/data/docker_mount/redis/data:/data:rw"
  148. command: "redis-server --requirepass ylink --appendonly yes"
  149. privileged: true
  150. restart: always
  151. networks:
  152. - ylink_net
  153. etcd:
  154. hostname: etcd
  155. image: bitnami/etcd:3
  156. privileged: true
  157. volumes:
  158. - "/data/docker_mount/etcd/data:/opt/bitnami/etcd/data"
  159. environment:
  160. - "ETCD_ADVERTISE_CLIENT_URLS=http://0.0.0.0:2379"
  161. - "ETCD_LISTEN_CLIENT_URLS=http://0.0.0.0:2379"
  162. - "ETCD_LISTEN_PEER_URLS=http://0.0.0.0:2380"
  163. - "ETCD_INITIAL_ADVERTISE_PEER_URLS=http://0.0.0.0:2380"
  164. - "ALLOW_NONE_AUTHENTICATION=yes"
  165. - "ETCD_INITIAL_CLUSTER=node1=http://0.0.0.0:2380"
  166. - "ETCD_NAME=node1"
  167. - "ETCD_DATA_DIR=/opt/bitnami/etcd/data"
  168. ports:
  169. - "2379:2379"
  170. - "2380:2380"
  171. networks:
  172. - ylink_net
  173. networks:
  174. ylink_net:
  175. name: ylink_net
  176. driver: bridge
  177. ipam:
  178. config:
  179. - subnet: 172.20.0.0/16