[Unit]
Description=nexus-timer (virt-nexus-timer)
Requires=docker.service
After=network.target docker.service
DefaultDependencies=no

[Service]
Type=simple
Environment="HOME=/root"
ExecStartPre=-/usr/bin/env sh -c '/usr/bin/env docker stop -t 3 virt-nexus-timer 2>/dev/null || true'
ExecStartPre=-/usr/bin/env sh -c '/usr/bin/env docker rm virt-nexus-timer 2>/dev/null || true'

ExecStart=/usr/bin/env docker run \
                        --rm \
                        --name=virt-nexus-timer \
                        --network=traefik \
                        --label-file /virt/nexus-timer/labels \
                              virt-nexus-timer

ExecStop=-/usr/bin/env sh -c '/usr/bin/env docker stop -t 3 virt-nexus-timer 2>/dev/null || true'
ExecStop=-/usr/bin/env sh -c '/usr/bin/env docker rm virt-nexus-timer 2>/dev/null || true'

Restart=always
RestartSec=30
SyslogIdentifier=virt-nexus-timer

[Install]
WantedBy=multi-user.target