version: '3.5' ######## 项目依赖的环境,启动项目之前要先启动此环境 ####### services: #jaeger链路追踪 jaeger: image: jaegertracing/all-in-one:latest container_name: jaeger restart: always ports: - "5775:5775/udp" - "6831:6831/udp" - "6832:6832/udp" - "5778:5778" - "16686:16686" - "14268:14268" - "9411:9411" environment: - "SPAN_STORAGE_TYPE=elasticsearch" - "ES_SERVER_URLS=http://elasticsearch:9200" - "LOG_LEVEL=debug" networks: - ylink_net # #搜集kafka业务日志、存储prometheus监控数据 elasticsearch: image: docker.elastic.co/elasticsearch/elasticsearch:7.13.4 container_name: elasticsearch user: root environment: - "discovery.type=single-node" - "ES_JAVA_OPTS=-Xms512m -Xmx512m" - "TZ=Asia/Shanghai" volumes: - "/data/docker_mount/elasticsearch/data:/usr/share/elasticsearch/data" restart: always ports: - "9200:9200" - "9300:9300" networks: - ylink_net #查看elasticsearch数据 kibana: image: docker.elastic.co/kibana/kibana:7.13.4 container_name: kibana environment: - "elasticsearch.hosts=http://elasticsearch:9200" - "TZ=Asia/Shanghai" restart: always networks: - ylink_net ports: - "5601:5601" depends_on: - elasticsearch #消费kafka中filebeat收集的数据输出到es go-stash: image: kevinwan/go-stash:1.0 # if you "macOs intel" or "linux amd" # image: kevinwan/go-stash:1.0-arm64 # if you "macOs m1" or "linux arm" container_name: go-stash environment: # 时区上海 TZ: "Asia/Shanghai" user: root restart: always volumes: - "/data/docker_mount/go-stash/etc:/app/etc" networks: - ylink_net depends_on: - elasticsearch - kafka #收集业务数据 filebeat: image: elastic/filebeat:7.13.4 container_name: filebeat environment: # 时区上海 TZ: "Asia/Shanghai" user: root restart: always entrypoint: "filebeat -e -strict.perms=false" #解决配置文件权限问题 volumes: - "/data/docker_mount/filebeat/conf/filebeat.yml:/usr/share/filebeat/filebeat.yml" # 此处需指定docker的containers目录,取决于你docker的配置 # 如snap安装的docker,则为/var/snap/docker/common/var-lib-docker/containers # - /var/snap/docker/common/var-lib-docker/containers:/var/lib/docker/containers - "/var/lib/docker/containers:/var/lib/docker/containers" networks: - ylink_net depends_on: - kafka #zookeeper是kafka的依赖 zookeeper: image: wurstmeister/zookeeper container_name: zookeeper environment: # 时区上海 TZ: "Asia/Shanghai" restart: always ports: - "2181:2181" networks: - ylink_net #消息队列 kafka: image: wurstmeister/kafka container_name: kafka ports: - "9092:9092" environment: - "KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092" - "KAFKA_LISTENERS=PLAINTEXT://0.0.0.0:9092 " - "KAFKA_ADVERTISED_HOST_NAME=kafka" - "KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181" - "KAFKA_AUTO_CREATE_TOPICS_ENABLE=false" - "TZ=Asia/Shanghai" - "KAFKA_BROKER_ID=0" - "KAFKA_ADVERTISED_PORT=9092" restart: always volumes: - "/var/run/docker.sock:/var/run/docker.sock" networks: - ylink_net depends_on: - zookeeper kafka-ui: image: provectuslabs/kafka-ui container_name: kafka-ui ports: - "8080:8080" restart: always environment: - "KAFKA_CLUSTERS_0_NAME=local" - "KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS=kafka:9092" - "KAFKA_CLUSTERS_0_ZOOKEEPER=zookeeper:2181" networks: - ylink_net #redis容器 redis: image: redis:6.2.5 container_name: redis ports: - "6379:6379" environment: - "TZ=Asia/Shanghai" volumes: # 数据文件 - "/data/docker_mount/redis/data:/data:rw" command: "redis-server --requirepass ylink --appendonly yes" privileged: true restart: always networks: - ylink_net etcd: hostname: etcd image: bitnami/etcd:3 privileged: true volumes: - "/data/docker_mount/etcd/data:/opt/bitnami/etcd/data" environment: - "ETCD_ADVERTISE_CLIENT_URLS=http://0.0.0.0:2379" - "ETCD_LISTEN_CLIENT_URLS=http://0.0.0.0:2379" - "ETCD_LISTEN_PEER_URLS=http://0.0.0.0:2380" - "ETCD_INITIAL_ADVERTISE_PEER_URLS=http://0.0.0.0:2380" - "ALLOW_NONE_AUTHENTICATION=yes" - "ETCD_INITIAL_CLUSTER=node1=http://0.0.0.0:2380" - "ETCD_NAME=node1" - "ETCD_DATA_DIR=/opt/bitnami/etcd/data" ports: - "2379:2379" - "2380:2380" networks: - ylink_net networks: ylink_net: name: ylink_net driver: bridge ipam: config: - subnet: 172.20.0.0/16