mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-09-24 11:06:24 +02:00
Compute per-container CPU/RAM shares based on active services (web-/svc-*, enabled=true or undefined). Cast host facts to numbers, add safe min=1, and output compose-ready values. Include robust unit test. Also: include resource.yml.j2 in base template and minor formatting tidy-up. https://chatgpt.com/share/68d2d96c-9bf4-800f-bbec-d4f2c0051c06
11 lines
314 B
Django/Jinja
11 lines
314 B
Django/Jinja
{# Base for docker services #}
|
|
|
|
restart: {{ DOCKER_RESTART_POLICY }}
|
|
{% if application_id | has_env %}
|
|
env_file:
|
|
- "{{ docker_compose.files.env }}"
|
|
{% endif %}
|
|
logging:
|
|
driver: journald
|
|
{{ lookup('template', 'roles/docker-container/templates/resource.yml.j2') | indent(4) }}
|
|
{{ "\n" }} |