Skip to content

Docker Compose file example for RabbitMQ

yaml
version: "3.8"
services:
  rabbitmq:
    container_name: rabbitmq
    hostname: rabbitmq
    image: rabbitmq:3-management
    restart: always
    ports:
      - "4369:4369"
      - "5671:5671"
      - "5672:5672"
      - "15672:15672"
    volumes:
      - "./data:/var/lib/rabbitmq"
    environment:
      RABBITMQ_DEFAULT_USER: user
      RABBITMQ_DEFAULT_PASS: password
  
    networks:
      - rabbitmq
    
networks:
  rabbitmq:
    driver: bridge

docker-compose -f <file> up -d to start the container.