version: "3"
services:
zipkin:
build: ./zipkin
image: zipkin-demo:latest
# restart: always
ports:
- "9411:9411"
depends_on:
- zookeeper
- kafka
sentinel:
build: ./sentinel
image: sentinel-dashboard:latest
ports:
- "7777:7777"
zookeeper:
image: zookeeper
# restart: always
ports:
- "2181:2181"
kafka:
image: wurstmeister/kafka
# restart: always
ports:
- "9092:9092"
environment:
KAFKA_BROKER_ID: 1
KAFKA_LISTENERS: PLAINTEXT://kafka:9092
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
volumes:
- ./docker.sock:/var/run/docker.sock
depends_on:
- zookeeper
redis:
image: redis
# container_name: redis_02
# restart: always
ports:
- "6379:6379"
volumes:
- ./redis/redis.conf:/usr/local/etc/redis/redis.conf
- ./redis/redis_02/data:/data
command:
redis-server /usr/local/etc/redis/redis.conf --appendonly yes
seata-server:
image: seataio/seata-server:1.4.2
# restart: always
ports:
- "8091:8091"
environment:
SEATA_PORT: 8091
STORE_MODE: db
SEATA_IP: 192.168.1.104 # 不指定的话,nacos服务上注册的IP是docker容器的地址,项目访问不了
# SEATA_CONFIG_NAME: file:/root/seata-config/registry
volumes:
- "./seata-logs/logs:/root/logs/seata"
# - "/home/shanks/seata-server-1.4.2/conf:/root/seata-config"
- "./registry.conf:/seata-server/resources/registry.conf"
- "./file.conf:/seata-server/resources/file.conf"
rmqnamesrv:
image: foxiswho/rocketmq:server
# container_name: mqnamesrv
ports:
- "9876:9876"
environment:
JAVA_OPT: -server -Xms256m -Xmx256m
volumes:
- "./data/logs:/opt/logs"
- "./data/store:/opt/store"
mqbroker:
image: foxiswho/rocketmq:broker
# container_name: mqbroker
ports:
- 10911:10911
- 10909:10909
volumes:
- ./data/logs:/opt/logs
- ./data/store:/opt/store
- ./brokerconf/broker.conf:/etc/rocketmq/broker.conf
environment:
NAMESRV_ADDR: "rmqnamesrv:9876"
JAVA_OPTS: " -Duser.home=/opt"
JAVA_OPT_EXT: "-server -Xms128m -Xmx128m -Xmn128m"
command: mqbroker -c /etc/rocketmq/broker.conf
depends_on:
- rmqnamesrv
rmqconsole:
image: styletang/rocketmq-console-ng
# container_name: rmqconsole
ports:
- 8081:8080
environment:
JAVA_OPTS: "-Drocketmq.namesrv.addr=rmqnamesrv:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false"
depends_on:
- rmqnamesrv
这是我用docker-compose.yml部署的,nacos没用docker是因为我单机上模拟docker集群注册上的机器节点显示的都是节点有重复的问题而且都是docker内部ip,所以naocs就物理机启动了。sentinel部署远程连接我本地应用查看日志会报health check超时问题导致nacos配置未同步到sentinel上。其他服务我本地应用都可以连接上。可以给你做参考,涉及到的配置文件如果有问题可以@我。分享是一种美德