Skip to content

Commit

Permalink
Fix container systemd template
Browse files Browse the repository at this point in the history
  • Loading branch information
medanthelinium committed Nov 12, 2024
1 parent cbed32b commit c234ffe
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions templates/systemd/container.service
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ ExecStartPre=docker create --name={{ container.container_name }} --rm \
{%- if container.entrypoint|default(none) %}
--entrypoint={{ container.entrypoint|quote }} \
{%- endif %}
{%- for dependency in container.depends_on | default([]) %}
Wants={{ dependency }}.service
{%- endfor %}
{{ container.image|quote }}{{ '' if not container.command|default(none) or container.command.items()|rejectattr('1', 'eq', none)|first|default(none) is none else ' \\' }}
{%- for _, argument in (container.command.items()|rejectattr('1', 'eq', none) if container.command|default(none) else []) %}
{{ argument|quote }}{% if not loop.last %} \{%- endif %}
Expand All @@ -71,6 +68,10 @@ ExecStop=docker stop --time={{ container.container_stop_timeout|default(50) }} {
[Install]
WantedBy=multi-user.target
WantedBy=docker.service
{%- for dependency in container.depends_on | default([]) %}
Wants={{ dependency }}.service
{%- endfor %}

{%- endmacro %}

{% macro All(container) -%}
Expand Down

0 comments on commit c234ffe

Please sign in to comment.