使用 Docker 搭建 RabbitMQ
compose file
version: "3.4"
services:
rabbitmq-docker:
image: rabbitmq:3.8.2-management
container_name: rabbitmq-docker
hostname: rabbitmq
environment:
- RABBITMQ_DEFAULT_USER=admin
- RABBITMQ_DEFAULT_PASS=admin
ports:
- "5672:5672"
- "15672:15672"
volumes:
- "rabbitmq:/var/lib/rabbitmq/mnesia" # 挂载数据目录
volumes:
rabbitmq:
15672 是 Web 管理页面的端口:http://localhost:15672/