docker 安装 rabbitmq 消息队列

1,创建必要的目录

cd /usr/local/docker/
mkdir rabbitmq
cd rabbitmq
mkdir data

2,docker-compose.yml 文件的内容

version: ‘3.1‘
services:
  rabbitmq:
    restart: always
    image: rabbitmq:management
    container_name: rabbitmq
    ports:
      - 5672:5672
      - 15672:15672
    environment:
      TZ: Asia/Shanghai
      RABBITMQ_DEFAULT_USER: rabbit
      RABBITMQ_DEFAULT_PASS: 123456
    volumes:
      - ./data:/var/lib/rabbitmq

3,启动

docker-compose up -d

4,访问 ip:15672,登入的账号密码:rabbirmq/123456

docker 安装 rabbitmq 消息队列