From 4b4ae6f1a974e4537a10d5a1a8b651eed896dc3d Mon Sep 17 00:00:00 2001 From: Quynh Nguyen Date: Thu, 15 May 2025 04:30:48 +0000 Subject: [PATCH] Add monitor/setup/serverlite_node.sh --- monitor/setup/serverlite_node.sh | 47 ++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 monitor/setup/serverlite_node.sh 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