Skip to content

Instantly share code, notes, and snippets.

@formix
Last active January 9, 2019 20:57
Show Gist options
  • Save formix/f710460c72678c682f90f870fd9df45d to your computer and use it in GitHub Desktop.
Save formix/f710460c72678c682f90f870fd9df45d to your computer and use it in GitHub Desktop.
#create /etc/systemd/system/[myapp].service
[Unit]
Description=[myapp]
After=network.target
[Service]
ExecStart=/usr/local/bin/node /home/pi/proj/app.js
Restart=always
RestartSec=10
#User=nobody
#Group=nobody
#Environment=PATH=/usr/bin:/usr/local/bin
Environment=NODE_ENV=production PORT=5000
WorkingDirectory=/home/pi/proj
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment