[Unit] Description=CronAlarm Web UI # user services CANNOT reference system services #Requires=docker.service #After=docker.service [Service] Restart=always # Shutdown container (if running) when unit is stopped ExecStartPre=/usr/bin/docker compose -f %h/projects/CronAlarm/docker-compose.yml down -v # Start container when unit is started ExecStart=/usr/bin/docker compose -f %h/projects/CronAlarm/docker-compose.yml up # Stop container when unit is stopped ExecStop=/usr/bin/docker compose -f %h/projects/CronAlarm/docker-compose.yml down -v # Hardening ProtectSystem=full PrivateTmp=true SystemCallArchitectures=native MemoryDenyWriteExecute=true NoNewPrivileges=true [Install] WantedBy=default.target