Files
computer-playbook/roles/sys-svc-container/templates/base.yml.j2
kevinveenbirkenbachandClaude Opus 4.8 d4ee9a85ba refactor(compose): align templates to the service_name skeleton
Every compose.yml.j2 now declares services as '{{ service_name }}:' with
its '{% set %}' knobs on two-space lines above the key, includes at four
spaces and if/for tags aligned to the content they wrap. The layout
renders correctly because stack_host_template enables lstrip_blocks for
compose.yml.j2; indent(4, True) in the container base and '{%+' guards
in whitespace-sensitive scalars keep the shared fragments identical
under both render modes. A new lint test enforces the skeleton.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-04 02:36:58 +02:00

20 lines
641 B
Django/Jinja

{# Base for docker services #}
{{ lookup('compose_restart', docker_restart_policy | default(DOCKER_RESTART_POLICY)) }}
{% if docker_compose_env is defined and docker_compose_env != '' %}
env_file:
- "{{ docker_compose_env }}"
{% elif application_id | has_env %}
env_file:
- "{{ lookup('container', application_id, 'files.env') }}"
{% endif %}
logging:
driver: journald
{% if DEPLOYMENT_MODE == 'compose' %}
{% filter indent(4, True) %}
{% include 'roles/sys-svc-container/templates/resource.yml.j2' %}
{% endfilter %}
{% endif %}
{% include 'roles/sys-svc-container/templates/deploy.yml.j2' %}
{{ "\n" }}