Created
May 20, 2019 18:00
-
-
Save Jamp/08fda08700109fedc59dce80c239f32d to your computer and use it in GitHub Desktop.
Systemd config for NodeJS App
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Application NodeJS | |
# Requires the mysql service to run first | |
Requires=After=mysql.service | |
[Service] | |
ExecStart=/usr/bin/node /app/main.js | |
# Required on some systems | |
WorkingDirectory=/app | |
Restart=always | |
# Restart service after 10 seconds if node service crashes | |
RestartSec=10 | |
# Output to syslog | |
StandardOutput=syslog | |
StandardError=syslog | |
SyslogIdentifier=nodejs-app | |
Environment=NODE_ENV=production PORT=3000 | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment