[systemd] Add a node@ service file
This commit is contained in:
18
systemd/.config/systemd/user/node@.service
Normal file
18
systemd/.config/systemd/user/node@.service
Normal 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
|
||||
Reference in New Issue
Block a user