docker-compose.yml:
version: '3.1'
services:
rabbitmq:
image: rabbitmq:management
container_name: rabbitmq
#restart: always
ports:
- 5672:5672 # java连接端口
- 15672:15672 # 浏览器连接端口
# - 25672:25672 # 集群
volumes:
- ./data:/var/lib/rabbitmq
注意镜像名称是rabbitmq:management,意思是同时安装客户端插件,不然在浏览器访问不了