Skip to content

Instantly share code, notes, and snippets.

@nicolas-zozol
Created January 14, 2021 09:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nicolas-zozol/8bcb215a629488549166059db7d99f35 to your computer and use it in GitHub Desktop.
Save nicolas-zozol/8bcb215a629488549166059db7d99f35 to your computer and use it in GitHub Desktop.
nodejs systemd file config
[Unit]
Description=My app
After=syslog.target
[Service]
User=www-data
Type=simple
ExecStart=/home/myuser/mywebsite/node_modules/next/dist/bin/next start -p $PORT
SuccessExitStatus=130
RestartSec=3
Restart=on-failure
StandardOutput=append:/var/log/mywebsite/logs.log
StandardError=inherit
EnvironmentFile=/home/myuser/mywebsite.env
WorkingDirectory=/home/myuser/mywebsite
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment