Aim

In this post we will install RabbitMQ using docker compose

Prerequisite

  • You need to have Docker installed on your machine
  • You need to have Docker Compose installed on your machine

Step 1 : Create the docker compose file

touch rabbitmq-docker-compose.yml

Step 2 : Create RabbitMQ service in docker compose

  • Put following components in the file created in step 1
version: "3"
services:
  rabbitmq:
    image: "rabbitmq:3-management"
    hostname: "rabbitmq"
    container_name: "rabbitmq"
    environment:
      RABBITMQ_ERLANG_COOKIE: "SWQOKODSQALRPCLNMEQG"
      RABBITMQ_DEFAULT_USER: "admin"
      RABBITMQ_DEFAULT_PASS: "password"
      RABBITMQ_DEFAULT_VHOST: "/"
    ports:
      - "15672:15672"
      - "5672:5672"

Step 3 : Start RabbitMQ

  • This will start the RabbitMQ in foreground mode
docker-compose -f rabbitmq-docker-compose.yml up
  • If you want to start RabbitMQ in background mode then use below command
docker-compose -f rabbitmq-docker-compose.yml up -d 

Happy Coding

0 0 vote
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x