How to create two different services of RabbitMQ?

Hello!
I’m trying to run two instances of RabbitMQ on my Windows 10 using Docker Desktop 2.1.0.1.
Here is my docker-compose.yml:
services:

  rabbitmqLS:
    image: "rabbitmq:3.7.17-management"
    hostname: "rabbitmqLS"
    ports:
      - "15672:15672"
      - "5672:5672"
      - "1883:1883"
    labels:
      NAME: "rabbitmqLS"
    volumes:
      - ./rabbitmq-isolated.conf:/etc/rabbitmq/rabbitmq.config
      - ./rabbit_enabled_plugins:/etc/rabbitmq/enabled_plugins
    restart: always

  rabbitmqCS:
    image: "rabbitmq:3.7.17-management"
    hostname: "rabbitmqCS"
    ports:
      - "15673:15673"
      - "5673:5673"
      - "1884:1884"
    labels:
      NAME: "rabbitmqCS"
    volumes:
      - ./rabbitmq-isolated.conf:/etc/rabbitmq/rabbitmq.config
      - ./rabbit_enabled_plugins:/etc/rabbitmq/enabled_plugins
    restart: always

Then I run the command:
docker-compose -f docker-compose-dev.yml up -d
However managent is available only on address with port 15672. And there is no available page on localhost:15673.
What should I do to run two RabbitMQ properly?

Seems like you are using the same configuration for both RabbitMQ instances. That would make the container internal port to be the same.

Try changing the

ports:
  - "15673:15673"
  - "5673:5673"
  - "1884:1884"

to

 ports:
  - "15673:15672"
  - "5673:5672"
  - "1884:1883"
1 Like

Thank You! That was the mistake.

1 Like