文档说明:只记录关键地方;
试验环境: linux debian 11
rabbitmq
version: "3"
services:
rabbitmq-server:
image: rabbitmq:3-management-alpine
container_name: rabbitmq
hostname: my-rabbit
restart: always
environment:
- RABBITMQ_DEFAULT_USER=guest
- RABBITMQ_DEFAULT_PASS=guest
- RABBITMQ_DEFAULT_VHOST=/
volumes:
- ./rabbitmq-data:/var/lib/rabbitmq
ports:
- "15672:15672"
- "5672:5672"
networks:
- default
启动、关闭、查看日志
# 启动
docker-compose -f docker-compose.yaml up -d
# 关闭
docker-compose -f docker-compose.yaml down --remove-orphans
# 查看日志
docker-compose -f docker-compose.yaml logs -f