31 lines
1.1 KiB
Desktop File
31 lines
1.1 KiB
Desktop File
[Unit]
|
|
Description=dvorakmortonxd.dev dev server (custom Next.js dev wrapper)
|
|
Documentation=file:///home/martin/dvorakmortonxd.dev/README.md
|
|
After=network-online.target
|
|
Wants=network-online.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
User=martin
|
|
Group=martin
|
|
WorkingDirectory=/home/martin/dvorakmortonxd.dev
|
|
# A system service does not inherit a login environment, so set HOME/PATH
|
|
# explicitly (Next.js wants a writable HOME for its cache).
|
|
Environment=HOME=/home/martin
|
|
Environment=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
|
# Bind all interfaces so the Cloudflare tunnel host can reach :3000. The dev
|
|
# server reads process.env.HOSTNAME, so pin it rather than inheriting it.
|
|
Environment=HOSTNAME=0.0.0.0
|
|
Environment=PORT=3000
|
|
# A reboot can leave a stale dev lock behind; clear it before starting.
|
|
ExecStartPre=/bin/rm -f /home/martin/dvorakmortonxd.dev/.next/dev/lock
|
|
ExecStart=/bin/node /home/martin/dvorakmortonxd.dev/scripts/dev-server.mjs
|
|
Restart=always
|
|
RestartSec=3
|
|
# Give Next.js a moment to shut down cleanly.
|
|
TimeoutStopSec=15
|
|
StandardOutput=journal
|
|
StandardError=journal
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|