2024-10-06 17:24:38 +02:00
|
|
|
[Unit]
|
|
|
|
Description=speedtest service using docker compose
|
|
|
|
Requires=docker.service
|
|
|
|
After=docker.service
|
|
|
|
Before=nginx.service
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
Type=simple
|
|
|
|
|
|
|
|
User=speedtest
|
|
|
|
Group=speedtest
|
|
|
|
|
|
|
|
Restart=always
|
|
|
|
TimeoutStartSec=1200
|
|
|
|
|
|
|
|
WorkingDirectory=/opt/speedtest
|
|
|
|
|
|
|
|
# Make sure no old containers are running
|
|
|
|
ExecStartPre=/usr/bin/docker-compose down -v
|
2024-11-14 18:23:31 +01:00
|
|
|
# Update images
|
|
|
|
ExecStartPre=-/usr/bin/docker-compose pull --quiet
|
2024-10-06 17:24:38 +02:00
|
|
|
|
|
|
|
# Compose up
|
|
|
|
ExecStart=/usr/bin/docker-compose up
|
|
|
|
|
|
|
|
# Compose down, remove containers and volumes
|
|
|
|
ExecStop=/usr/bin/docker-compose down -v
|
|
|
|
|
2024-11-14 18:23:31 +01:00
|
|
|
# Refresh on reload
|
|
|
|
ExecReload=-/usr/bin/docker-compose pull --quiet
|
|
|
|
ExecReload=/usr/bin/docker-compose up -d
|
|
|
|
|
2024-10-06 17:24:38 +02:00
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|