Keep RabbitMQ data on recreate and proxy to unique container names

RabbitMQ stores its data under rabbit@<hostname>, and the hostname
changed with every recreated container, so an image update or an .env
change came up with an empty broker. Pin it to `rabbitmq` and document
how to carry the definitions over on an existing deployment.

Every project shares infra-net, where a generic service name like `api`
resolves to every container that has it, round-robin, across projects.
The edge now proxies to container names (musify-api, infra-zitadel, ...).
This commit is contained in:
2026-09-24 15:05:43 +02:00
parent 6dcbd9589a
commit 3e1ee28125
3 changed files with 35 additions and 7 deletions
+4
View File
@@ -192,6 +192,10 @@ services:
rabbitmq:
image: rabbitmq:4-management-alpine
container_name: infra-rabbitmq
# The node is named rabbit@<hostname> and its data lives under that name.
# Without a fixed hostname every recreated container gets a new one and
# starts on an empty data directory (users, vhosts, queues all gone).
hostname: rabbitmq
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_DEFAULT_USER}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_DEFAULT_PASS}