version: ‘2’
services:
#rabbitmq container
rabbitmq:
#setup host name
hostname: rabbit
container_name: rabbit
#use docker images
image: rabbitmq:3-management
#ports setting
ports:
- 15672:15672
- 5672:5672
restart: always
environment:
- RABBITMQ_DEFAULT_USER=admin #用户名
- RABBITMQ_DEFAULT_PASS=admin #密码
#volumes setting
volumes:
- ./data:/var/lib/rabbitmq