Last active
April 18, 2019 07:07
-
-
Save darshitvvora/e9e155ea17a79a1f61e87c25164f9d8e to your computer and use it in GitHub Desktop.
Sample Linux service file - /etc/systemd/system
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=API Server | |
| After=syslog.target | |
| [Service] | |
| WorkingDirectory=/home/user/repo/api | |
| ExecStart=/usr/local/bin/node server/boot | |
| ExecReload=/usr/bin/kill -HUP $MAINPID | |
| Restart=always | |
| StandardOutput=syslog | |
| StandardError=syslog | |
| SyslogIdentifier=api | |
| User=user | |
| Group=user | |
| Environment="APP_MAIN=server" | |
| Environment="WORKER_COUNT=2" | |
| EnvironmentFile=/home/user/repo/api/.env | |
| [Install] | |
| WantedBy=multi-user.target |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add boot.js in server folder. It is assume using angular full stack folder structure. This will spin API on 2 cores
boot.js script -https://gist.github.com/darshitvvora/7d49d7243ca1351ff4ecc5d7ca0adf2c