Production-ready RabbitMQ 4 message broker with declarative JSON-based provisioning (Infrastructure-as-Code), layered TLS, Prometheus metrics, and full CI/CD automation.
Tracks the floating 4-management image tag — always the latest RabbitMQ 4.x,
with the major pinned to avoid a breaking jump to 5.x.
A thin, professional wrapper around the official rabbitmq:*-management image plus
a Python init sidecar that provisions your entire topology — vhosts, users,
permissions, exchanges, queues, bindings, policies, shovels — from a single JSON file.
- Modern broker — RabbitMQ 4.x (floating
4-management), quorum queues by default (HA-ready; classic mirrored queues were removed in 4.0). AMQP 0-9-1 + AMQP 1.0 core. - Declarative provisioning (IaC) — an idempotent init container applies your
topology from JSON on every start, via the Management HTTP API:
- Virtual hosts, users (+ tags), permissions & topic permissions
- Exchanges, queues (quorum/classic/stream), bindings (dedup-checked)
- Policies, operator policies, shovel/federation parameters
${ENV_VAR}resolution keeps secrets out of config files; additive & idempotent
- Sizing presets — small / medium / large tuning, documented as a table in
.env.example, keyed by the real RAM drivers (connections, queues, backlog). Default: small. - Layered TLS — self-signed (zero-config) → managed Let's Encrypt (certs-dumper sidecar) → bring-your-own. AMQPS on 5671; the web UI gets HTTPS via Traefik/Coolify.
- Plugins — Management, Prometheus, Shovel, Federation on by default; MQTT / STOMP (+ Web variants) shipped and runtime-toggleable via env.
- Four deployment modes — development (local build), single (direct ports), Traefik (HTTPS + LE), Coolify (dashboard domains).
- CI/CD automation — semantic releases, GHCR image builds, base-image monitoring, Dependabot auto-merge, SBOMs, Teams + AI issue triage.
-
Clone & enter
git clone https://github.com/bauer-group/CS-RabbitMQ.git cd CS-RabbitMQ -
Generate
.env(fills everyCHANGE_ME_*secret with random hex)python scripts/generate-env.py
-
Review
.env— set at minimumRABBITMQ_ADMIN_PASSWORD(done by the generator), pick a sizing preset, and set hostnames for Traefik/Coolify. -
(Optional) Define your topology — copy
config/rabbitmq-init.example.jsontoconfig/rabbitmq-init.jsonand edit. (Development mounts the example automatically.) -
Start
# Development (local builds, mounts the example topology) docker compose -f docker-compose.development.yml up -d --build # Single (direct ports, pre-built GHCR images) docker compose -f docker-compose.single.yml up -d # Traefik (HTTPS UI via Let's Encrypt) docker compose -f docker-compose.traefik.yml up -d
-
Access
Mode AMQP AMQPS Management UI Prometheus Development / Single localhost:5672localhost:5671http://localhost:15672http://localhost:15692/metricsTraefik ${AMQP_HOSTNAME}:5672${AMQP_HOSTNAME}:5671https://${CONSOLE_HOSTNAME}(internal) Log in with
RABBITMQ_ADMIN_USER/RABBITMQ_ADMIN_PASSWORD. The insecureguestaccount is never created (a default user is defined), is restricted to loopback by config, and is actively deleted by the init container on every run — three independent layers.
┌──────────────────────────────────────────────────────────────┐
│ Docker Compose Stack │
│ │
│ ┌────────────────────┐ ┌──────────────────────────┐ │
│ │ rabbitmq │◄───────│ rabbitmq-init │ │
│ │ (custom image) │ HTTP │ (one-shot) │ │
│ │ │ API │ │ │
│ │ AMQP :5672 │ │ Reads /config/init.json │ │
│ │ AMQPS :5671 │ │ (volume/seed) and PUTs │ │
│ │ Mgmt :15672 │ │ vhosts/users/queues/ │ │
│ │ Prom :15692 │ │ exchanges/policies/... │ │
│ │ │ │ Idempotent on restart │ │
│ │ Quorum by default │ └──────────────────────────┘ │
│ │ Self-signed/LE TLS │ │
│ └────────────────────┘ (Traefik profile adds certs-dumper) │
│ │
└──────────────────────────────────────────────────────────────┘
| Mode | Compose file | UI exposure | Use for |
|---|---|---|---|
| Development | docker-compose.development.yml |
host port | local builds & testing (mounts demo topology) |
| Single | docker-compose.single.yml |
host port | simple single-host, GHCR images |
| Traefik | docker-compose.traefik.yml |
Traefik + Let's Encrypt | HTTPS UI, optional LE cert on AMQPS |
| Coolify | docker-compose.coolify.yml |
Coolify dashboard | PaaS-managed domains & TLS |
Everything is driven from .env:
- Sizing —
RABBITMQ_VM_MEMORY_HIGH_WATERMARK(absolute; no hard container cap by design),RABBITMQ_DISK_FREE_LIMIT,RABBITMQ_CHANNEL_MAX,RABBITMQ_CONSUMER_TIMEOUT, … See the preset tables in.env.exampleand docs/sizing-and-tuning.md. - TLS —
RABBITMQ_TLS_MODE(selfsigned|managed|byo). See docs/tls-and-certificates.md. - Topology —
config/rabbitmq-init.json. See docs/messaging-topology.md. - Protocols —
RABBITMQ_ENABLE_MQTT/…_STOMP(+ Web variants).
The broker image renders its tuning config from these env vars at boot
(src/rabbitmq/etc/rabbitmq/conf.d/90-tuning.conf.template) — no committed-file
mutation. See src/rabbitmq/README.md.
| Port | Purpose |
|---|---|
| 5672 | AMQP 0-9-1 / AMQP 1.0 |
| 5671 | AMQPS (AMQP over TLS) |
| 15672 | Management UI / HTTP API |
| 15692 | Prometheus metrics |
| 25672 | inter-node / CLI (Erlang distribution) |
| 1883 / 8883 | MQTT / MQTTS (optional) |
| 61613 | STOMP (optional) |
- Installation
- Messaging topology (IaC)
- TLS & certificates
- Sizing & tuning
- Clustering (scale-out path)
- Init container reference
- Server image reference
MIT License — BAUER GROUP. See LICENSE.