keviocastro/rabbitmq

By keviocastro

Updated 10 months ago

RabbitMQ com Entrypoint para Clustering

Image
Message Queues
0

175

Imagem RabbitMQ com Entrypoint para Clustering

Esta imagem Docker é baseada na imagem oficial do RabbitMQ 3-management e adiciona um script de entrada personalizado para facilitar a configuração de um cluster RabbitMQ.

Características

Baseada na imagem oficial do RabbitMQ 3-management. Inclui um script de entrada personalizado (cluster-entrypoint.sh) que automatiza a configuração de um cluster RabbitMQ.

Uso

Esta imagem é destinada a ser usada em um ambiente Docker Swarm para criar um cluster RabbitMQ. O script de entrada verifica as variáveis de ambiente CLUSTERED e CLUSTER_WITH. Se CLUSTERED estiver definido e CLUSTER_WITH estiver definido, o script irá parar o aplicativo RabbitMQ, juntá-lo ao cluster especificado por CLUSTER_WITH e reiniciar o aplicativo RabbitMQ.

Exemplo de uso

version: "3.9"
services:
  rabbitmq:
    image: my-rabbitmq:latest
    hostname: "{{.Service.Name}}.{{.Task.Slot}}.{{.Task.ID}}"
    environment:
      - RABBITMQ_ERLANG_COOKIE=secret_cookie
      - RABBITMQ_DEFAULT_USER=admin
      - RABBITMQ_DEFAULT_PASS=segredodeestado
      - RABBITMQ_DEFAULT_VHOST=/
      - CLUSTERED=true
      - CLUSTER_WITH=rabbitmq1
    volumes:
      - "/mnt/data/rabbitmq:/var/lib/rabbitmq/mnesia/"
    networks:
      - rabbitmq
    deploy:
      replicas: 3

RabbitMQ Image with Clustering Entrypoint

This Docker image is based on the official RabbitMQ 3-management image and adds a custom entrypoint script to facilitate the setup of a RabbitMQ cluster.

Features

Based on the official RabbitMQ 3-management image. Includes a custom entrypoint script (cluster-entrypoint.sh) that automates the setup of a RabbitMQ cluster.

Usage

This image is intended to be used in a Docker Swarm environment to create a RabbitMQ cluster. The entrypoint script checks for the CLUSTERED and CLUSTER_WITH environment variables. If CLUSTERED is set and CLUSTER_WITH is set, the script will stop the RabbitMQ application, join it to the cluster specified by CLUSTER_WITH, and restart the RabbitMQ application.

Example Usage

version: "3.9"
services:
  rabbitmq:
    image: my-rabbitmq:latest
    hostname: "{{.Service.Name}}.{{.Task.Slot}}.{{.Task.ID}}"
    environment:
      - RABBITMQ_ERLANG_COOKIE=secret_cookie
      - RABBITMQ_DEFAULT_USER=admin
      - RABBITMQ_DEFAULT_PASS=3l&3PSH6
      - RABBITMQ_DEFAULT_VHOST=/
      - CLUSTERED=true
      - CLUSTER_WITH=rabbitmq1
    volumes:
      - "/mnt/data/rabbitmq:/var/lib/rabbitmq/mnesia/"
    networks:
      - rabbitmq
    deploy:
      replicas: 3

Docker Pull Command

docker pull keviocastro/rabbitmq