cron-alarm.service 722 B

12345678910111213141516171819202122232425
  1. [Unit]
  2. Description=CronAlarm Web UI
  3. # user services CANNOT reference system services
  4. #Requires=docker.service
  5. #After=docker.service
  6. [Service]
  7. Restart=always
  8. RestartSec=10
  9. # Shutdown container (if running) when unit is stopped
  10. ExecStartPre=/usr/bin/docker compose -f %h/projects/CronAlarm/docker-compose.yml down -v
  11. # Start container when unit is started
  12. ExecStart=/usr/bin/docker compose -f %h/projects/CronAlarm/docker-compose.yml up
  13. # Stop container when unit is stopped
  14. ExecStop=/usr/bin/docker compose -f %h/projects/CronAlarm/docker-compose.yml down -v
  15. # Hardening
  16. ProtectSystem=full
  17. PrivateTmp=true
  18. SystemCallArchitectures=native
  19. MemoryDenyWriteExecute=true
  20. NoNewPrivileges=true
  21. [Install]
  22. WantedBy=default.target