homeserver-iac/roles/containers/templates/docker-compose.service.j2

18 lines
456 B
Django/Jinja

[Unit]
Description=Services manager with docker-compose
Requires=docker.service
After=docker.service
[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
[Install]
WantedBy=multi-user.target