目录结构
[root@meta rabbitmq]
.
├── config
│ └── rabbitmq.conf
├── data
│ └── mnesia
└── rabbitmq.yml
docker-compose 文件
version: '3'
services:
rabbitmq:
image: rabbitmq:3.8
container_name: rabbitmq
hostname: myRabbitmq
restart: always
ports:
- 15672:15672
- 5672:5672
volumes:
- ./data:/var/lib/rabbitmq:rw
- ./config/rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf
environment:
CONTAINER_TIMEZONE: Asia/Shanghai
rabbitMq配置文件( rabbitmq.conf )
loopback_users.guest = false
listeners.tcp.default = 5672
management.tcp.port = 15672
connection_max = 1024
default_pass=dc3
default_user=dc3
default_vhost=dc3
mqtt.vhost=dc3
容器启动后,需进入容器开启rabbitMq管理界面