Skip to content

Instantly share code, notes, and snippets.

@technosophos
Created July 30, 2024 20:33
Show Gist options
  • Save technosophos/f2b5ff9bc28f097423ccf0cb3c9188f1 to your computer and use it in GitHub Desktop.
Save technosophos/f2b5ff9bc28f097423ccf0cb3c9188f1 to your computer and use it in GitHub Desktop.
Ubuntu service for running Spin as a daemon
# Put this file in: /etc/systemd/system/spin.service
# then run
# systemctl enable spin
# systemctl daemon-reload
# systemctl start spin
[Unit]
Description = Spin application
After = network.target
[Service]
Type = simple
ExecStart = /usr/local/bin/spin up --from ghcr.io/technosophos/my-spin-app --listen 0.0.0.0:80
# For anything but testing, User and Group should be single-purpose Spin users.
User = root
Group = root
Restart = on-failure
RestartSec = 5
TimeoutStartSec = infinity
[Install]
WantedBy = multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment