Add pm2 setup to 3rd party init
parent
553dc492a6
commit
bcfe6cf49a
|
@ -1,5 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
cd $(dirname $0)
|
||||
|
||||
#####################################################
|
||||
###### INSTALL ALL REQUIRED 3RD-PARTY SOFTWARE ######
|
||||
#####################################################
|
||||
|
@ -10,7 +12,6 @@
|
|||
|
||||
# mongodb key & repo
|
||||
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
|
||||
|
||||
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | \
|
||||
sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list
|
||||
|
||||
|
@ -30,5 +31,8 @@ sudo ln -s ~/.nvm/versions/node/$(node -v)/bin/node /usr/bin/node
|
|||
# upgrade to latest npm version
|
||||
sudo npm install -g npm@latest
|
||||
|
||||
npm -v
|
||||
node -v
|
||||
if [ "${1}" == "prod" ]; then
|
||||
sudo npm install -g pm2
|
||||
pm2 start ./../../pm2-start.json
|
||||
pm2 startup systemd
|
||||
fi
|
|
@ -5,7 +5,10 @@
|
|||
"script": "./api/server.js",
|
||||
"watch": false,
|
||||
"env": {
|
||||
"TZ": "Europe/Berlin"
|
||||
"NODE_ENV": "production",
|
||||
"DEBUG": "cc:*",
|
||||
"TZ": "Europe/Berlin",
|
||||
"JWS_SECRET": "secret"
|
||||
}
|
||||
}
|
||||
]
|
Loading…
Reference in New Issue