Files
computer-playbook/roles/svc-db-memcached/templates/compose.yml.j2
kevinveenbirkenbachandClaude Opus 5.5 0f7fb92e12 refactor(roles): take seven roles' memory parameters from the container limit
Memcached, Joomla, Moodle, Odoo, Shopware, Snipe-IT and SuiteCRM set
their cache size, PHP memory_limit, OPcache, worker limits and search
heap as literals next to a mem_limit they never read. They now ask
lookup('service_memory_mb') for a share of that limit. The shares are
chosen so every rendered value stays what it was.

Where the parameter lives in a file that cannot hold a template, the
value is handed in: Shopware's init script reads INIT_PHP_MEMORY_LIMIT
and refuses to start without it, SuiteCRM's image takes it as a build
argument. Shopware's worker gets --memory-limit as a command appended
to its entrypoint, and Moodle's OPcache size moves from the static ini
into the rendered one.

The performance.php.memory_limit keys of Joomla and Moodle are gone
from services.yml; nothing else read them.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-06 23:24:22 +02:00

17 lines
724 B
Django/Jinja

{% include 'roles/sys-svc-compose/templates/base.yml.j2' %}
{% set service_name = 'memcached' %}
{{ service_name }}:
{{ lookup('compose_only', 'container_name', MEMCACHED_CONTAINER) }}
{{ lookup('container_image', application_id, 'memcached') }}
command: ["memcached", "-m", "{{ MEMCACHED_MEMORY_LIMIT_MB }}"]
{% include 'roles/sys-svc-container/templates/base.yml.j2' %}
{% if MEMCACHED_EXPOSE_LOCAL %}
{{ lookup('container_ports', ['memcached', 'memcached', DOCKER_BIND_HOST]) | indent(4) }}
{% endif %}
{{ lookup('container_networks') | indent(4) }}
{{ lookup('container_healthcheck', service_name) | indent(4) }}
{{ lookup('compose_volumes') }}
{{ lookup('compose_networks') }}