[Unit] Description=%i service with docker compose PartOf=docker.service After=docker.service [Service] Type=oneshot RemainAfterExit=true WorkingDirectory=/etc/docker/compose/%i ExecStartPre= /bin/sh -c 'until ping -c1 denali; do sleep 1; done;' ExecStart=/usr/bin/docker compose up -d --remove-orphans ExecStop=/usr/bin/docker compose down Restart=on-failure RestartSec=5s [Install] WantedBy=multi-user.target