diff --git a/monitor/setup/serverlite_node.sh b/monitor/setup/serverlite_node.sh new file mode 100644 index 0000000..d8595bd --- /dev/null +++ b/monitor/setup/serverlite_node.sh @@ -0,0 +1,47 @@ +#!/bin/bash +#*************serverlite nodejs**************************** +echo "install serverlite nodejs" +cd /root +git clone http://gitea.beetai.com/dongpd/BiFace_Server_Config_API.git + + +#sudo apt-get install -y nodejs npm +#sudo apt-get install -y nodejs-dev node-gyp libssl1.0-dev +#sudo apt install -y npm + +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash +chmod +x ~/.nvm/nvm.sh +. ~/.bashrc + +nvm install 16 + +npm install pm2@5.4.2 -g n +#sudo n stable +pm2 install pm2-logrotate + +cd BiFace_Server_Config_API +npm install + +cd /root/monitor/setup/ +pm2 ecosystem +echo " +module.exports = { + apps : [ + { + name: 'Server_lite', + cwd: '/root/BiFace_Server_Config_API', + script: 'server.js', + args: '', + interpreter: 'node', + restart_delay: 1000, + cron_restart: '0 0 * * *', + watch: false, + time: true + } +] +}; +" > ecosystem.config.js +pm2 reload ecosystem.config.js + +pm2 startup +pm2 save \ No newline at end of file