Files
computer-playbook/roles/svc-db-redis
Kevin Veen-Birkenbach 8d6ebb4693 Mailu/Redis: add explicit service resource limits & clamav_db volume
- use lookup(template) for redis resource injection
- add cpus/mem/pids configs for all Mailu services
- switch antivirus to dedicated clamav_db volume
- add MAILU_CLAMAV_VOLUME var
- cleanup set service_name per service in docker-compose template
https://chatgpt.com/share/68d3d69b-06f0-800f-8c4d-4a74471ab961
2025-09-24 13:31:54 +02:00
..
2025-07-17 00:34:54 +02:00
2025-08-08 17:25:31 +02:00

Redis

Description

This Ansible role provides a Jinja2 snippet to inject a Redis service definition into your Docker Compose setup. It renders a service.yml.j2 template that defines a redis container with sensible defaults.

Overview

The roles service.yml.j2 template includes:

  • An Alpine-based Redis image (redis:alpine)

  • Container naming based on application_id (defaults to redis)

  • Restart policy

  • Journald logging driver

  • A named volume (redis:/data) for persistence

  • A basic healthcheck using redis-cli ping

  • Attachment to the default network

Include this snippet in your top-level docker-compose.yml.j2 where you want Redis to appear.

Features

  • Configurable application_id
    Sets container name ({{ application_id }}-redis).

  • Restart policy
    Controlled by DOCKER_RESTART_POLICY.

  • Journald logging
    Ensures logs are captured by systemds journal.

  • Persistent storage
    Declares and mounts redis:/data.

  • Built-in healthcheck
    Uses redis-cli ping with configurable intervals and retries.

Further Resources