[systemd] Add a node@ service file

This commit is contained in:
2026-05-24 11:21:15 -04:00
parent 509ac4a0cf
commit b44666e31e

View File

@ -0,0 +1,18 @@
[Unit]
Description=Node.js dev server for %I
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
Environment=PATH=%h/.local/bin:/home/linuxbrew/.linuxbrew/bin:/usr/local/bin:/usr/bin:/bin:/home/powellc/.asdf/shims
EnvironmentFile=%h/.local/etc/node/%i.env
ExecStartPre=/bin/bash -lc 'cd "$NODE_PATH" && if [ -f docker-compose.yml ]; then docker-compose start; fi'
ExecStart=/bin/bash -c 'cd "$NODE_PATH" && exec direnv exec "$NODE_PATH" just run'
Restart=on-failure
RestartSec=2
StandardOutput=append:/tmp/node.log
StandardError=inherit
[Install]
WantedBy=default.target