ansible-role-docker_container/templates/docker_container.service.j2
2025-01-10 11:13:46 +02:00

15 lines
453 B
Django/Jinja

[Unit]
Description={{ docker_container_name }} docker container
After=docker.service
Requires=docker.service
[Service]
TimeoutStartSec=0
Restart=always
ExecStartPre=/usr/bin/docker pull {{ docker_container_name }}
ExecStart=/usr/bin/docker run --rm --name %n{% if docker_container_run_options is defined %} {{ docker_container_run_options }}{% endif %} {{ docker_container_name }}
ExecStop=/usr/bin/docker stop %n
[Install]
WantedBy=multi-user.target