diff --git a/deploy/thermograph-dev.service b/deploy/thermograph-dev.service new file mode 100644 index 0000000..30d22e2 --- /dev/null +++ b/deploy/thermograph-dev.service @@ -0,0 +1,20 @@ +# systemd --user unit for the Thermograph LAN dev server. +# Installed by deploy/deploy-dev.sh into ~/.config/systemd/user/ with the +# @PLACEHOLDER@ tokens substituted for this machine's paths/port. +# Runs sudo-free as your own user; linger keeps it up across logout/reboot. +[Unit] +Description=Thermograph (dev, LAN) - FastAPI/uvicorn +After=network-online.target +Wants=network-online.target + +[Service] +Type=exec +WorkingDirectory=@APP_DIR@/backend +Environment=THERMOGRAPH_BASE=@BASE@ +# Bind all interfaces so other devices on the LAN (e.g. your phone) can reach it. +ExecStart=@APP_DIR@/.venv/bin/uvicorn app:app --host 0.0.0.0 --port @PORT@ +Restart=on-failure +RestartSec=2 + +[Install] +WantedBy=default.target