homeserver-iac/roles/containers/templates/docker-compose.service.j2
dogeystamp c70e33e629
wireguard: clean up
- make variables less clunky
- make docker-compose run after wireguard (this seems janky right now)
2024-06-17 17:48:29 -04:00

24 lines
653 B
Django/Jinja

[Unit]
Description=Services manager with docker-compose
{% if wireguard_services %}
Requires=docker.service wg-quick@{{ wireguard_interface }}.service
After=docker.service wg-quick@{{ wireguard_interface }}.service
{% else %}
Requires=docker.service
After=docker.service
{% endif %}
[Service]
User=docker
Group=docker
WorkingDirectory={{ docker_compose_dir }}
ExecStartPre=-/usr/bin/docker compose pull
ExecStart=/usr/bin/docker compose up --remove-orphans
ExecStop=/usr/bin/docker compose down
ExecReload=/usr/bin/docker compose pull
ExecReload=/usr/bin/docker compose up --remove-orphans --detach
TimeoutSec=900
[Install]
WantedBy=multi-user.target