赞
踩
version: '3' services: rabbitmq: image: rabbitmq:management-alpine container_name: rabbitmq restart: always volumes: - ../data/rabbitmq/etc:/etc/rabbitmq - ../data/rabbitmq/var/lib:/var/lib/rabbitmq - ../data/rabbitmq/var/log:/var/log/rabbitmq networks: - sc-net ports: - 5672:5672 - 15672:15672 environment: - RABBITMQ_DEFAULT_USER: root - RABBITMQ_DEFAULT_PASS: root123 networks: sc-net: external: false
mkdir -p /data/rabbitmq/{etc,var/{lib,log}}
cd /data/rabbitmq/etc
touch enabled_plugins
touch rabbitmq.conf
echo "[rabbitmq_management,rabbitmq_prometheus]." > enabled_plugins
enabled_plugins 是为了开启web管理页面组件,访问:http://127.0.0.1:15672
$ docker-compose up
# 后台运行
$ docker-compose up -d
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。