跳转到主要内容

docker-compose部署rabbitmq

rabbitmq

docker-compse的yaml文件

compse.yaml

version: '3.3'
services:
  rabbitmq:
    image: rabbitmq:3.8-management
    container_name: rabbitmq    #容器的名字
    restart: always
    environment:
      - RABBITMQ_DEFAULT_USER=rabbitmq  #容器的# 默认用户
      - RABBITMQ_DEFAULT_PASS=iyfbvr1EM25mamq<your password> #默认密码
    ports:
      - 15672:5672
      - 25672:15672
    volumes:
      - ./rabbitmq_data:/var/lib/rabbitmq

启动rabbitmq

docker-compose -f docker-compse.yaml up -d