Skip to content

Commit

Permalink
Automatically restart contains on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark-Simulacrum committed Mar 7, 2024
1 parent 24f5b2e commit e60ca35
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ansible/roles/docker/templates/containers/container.service
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ ExecStart=/usr/bin/docker run --init --rm --name {{ item }} \
-w {{ container.working_dir }} \
{{ container.image }} {{ container.exec }}
ExecStop=/usr/bin/docker stop {{ item }}
Restart=on-failure
RestartSec=5s
{% for key, value in env.items() %}
Environment={{ key }}={{ value }}
{% endfor %}
Expand Down

0 comments on commit e60ca35

Please sign in to comment.