Without a named volume, RabbitMQ recreates its Mnesia database on every container restart, losing queue state and requiring the vhost and user to be re-provisioned. Adding `rabbitmq_data` as a named volume matches the pattern already used for PostgreSQL (`pgdata`). Assisted-by: Claude Opus 4.6 (1M context) Signed-off-by: Justin Wheeler <jwheel@fedoraproject.org>
70 lines
1.6 KiB
YAML
70 lines
1.6 KiB
YAML
version: "3"
|
|
services:
|
|
web:
|
|
build:
|
|
context: .
|
|
containerfile: Containerfile
|
|
environment:
|
|
DJANGO_SETTINGS_MODULE: happinesspackets.settings.dev
|
|
FEDORA_MESSAGING_CONF: /app/config.toml
|
|
ports:
|
|
- "8000:8000"
|
|
volumes:
|
|
- ./happinesspackets:/app/happinesspackets:z
|
|
- ./templates:/app/templates:z
|
|
- ./assets:/app/assets:z
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
command: >
|
|
bash -c "python manage.py migrate --noinput &&
|
|
gunicorn happinesspackets.wsgi:application --bind 0.0.0.0:8000 --reload"
|
|
|
|
db:
|
|
image: docker.io/postgres:17-alpine
|
|
environment:
|
|
POSTGRES_PASSWORD: example
|
|
POSTGRES_DB: postgres
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD", "pg_isready", "-U", "postgres"]
|
|
interval: 5s
|
|
retries: 5
|
|
|
|
redis:
|
|
image: docker.io/redis:7-alpine
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 5s
|
|
retries: 5
|
|
|
|
celery:
|
|
build:
|
|
context: .
|
|
containerfile: Containerfile
|
|
environment:
|
|
DJANGO_SETTINGS_MODULE: happinesspackets.settings.dev
|
|
command: celery -A happinesspackets worker -l info
|
|
depends_on:
|
|
- db
|
|
- redis
|
|
|
|
rabbitmq:
|
|
image: docker.io/rabbitmq:3-management-alpine
|
|
environment:
|
|
RABBITMQ_DEFAULT_USER: user
|
|
RABBITMQ_DEFAULT_PASS: pass
|
|
RABBITMQ_DEFAULT_VHOST: vhost
|
|
volumes:
|
|
- rabbitmq_data:/var/lib/rabbitmq:z
|
|
healthcheck:
|
|
test: ["CMD", "rabbitmqctl", "status"]
|
|
interval: 10s
|
|
retries: 5
|
|
|
|
volumes:
|
|
pgdata:
|
|
rabbitmq_data:
|