# Docker-compose 安装 RabbitMQ

  1. rabbitmq yaml 配置文件

    version: "3.0"
    services:
    rabbitmq:
       image: daocloud.io/library/rabbitmq:3.8.7
       container_name: rabbitmq
       restart: always
       volumes:
          - ./data/:/var/lib/rabbitmq/
       ports:
          - 5672:5672
          - 15672:15672
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
  2. rabbitmq授权

    rabbitmqctl add_user root qwe123
    rabbitmqctl set_permissions -p / root ".*" ".*" ".*"
    rabbitmqctl set_user_tags root administrator
    
    1
    2
    3
  3. 第三方服务进行连接

    AMQP_URI=amqp://root:qwe123@IP地址:5672
    
    1
上次更新: 2023/12/27