-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmyserver.service
36 lines (36 loc) · 1.06 KB
/
myserver.service
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
[Unit]
Description=Nhanify
# Documentation=https://
# Author: Natan Cabral
[Service]
# Start Service and Examples
ExecStart=/home/ubuntu/.nvm/versions/node/v21.7.3/bin/node app.js
# ExecStart=/usr/bin/sudo /usr/bin/node /home/myserver/server.js
# ExecStart=/usr/local/bin/node /var/www/project/myserver/server.js
# Options Stop and Restart
# ExecStop=
# ExecReload=
# Required on some systems
WorkingDirectory=/home/ubuntu/nhanify
#WorkingDirectory=/var/www/myproject/
# Restart service after 10 seconds if node service crashes
RestartSec=10
Restart=always
# Restart=on-failure
# Output to syslog
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=nhanify
# #### please, not root users
# RHEL/Fedora uses 'nobody'
User=ubuntu
# Debian/Ubuntu uses 'nogroup', RHEL/Fedora uses 'nobody'
# Group=nogroup
# variables
EnvironmentFile=/home/ubuntu/nhanify/.env
# Environment=NODE_ENV=production
# Environment=NODE_PORT=3001
# Environment="SECRET=pGNqduRFkB4K9C2vijOmUDa2kPtUhArN"
# Environment="ANOTHER_SECRET=JP8YLOc2bsNlrGuD6LVTq7L36obpjzxd"
[Install]
WantedBy=multi-user.target