upgrade package

This commit is contained in:
yi-ge 2021-08-04 16:48:25 +08:00
parent 58821bef70
commit e5ca37faed
3 changed files with 24 additions and 2 deletions

View File

@ -2,6 +2,7 @@
"cSpell.words": [
"Weibo",
"Weixin",
"autorestart",
"categorys",
"consola",
"eslintignore",

16
ecosystem.config.js Normal file
View File

@ -0,0 +1,16 @@
module.exports = {
apps: [{
name: 'blog-client',
script: './dist/app.js',
watch: false,
max_memory_restart: '3G', // 超过多大内存自动重启,仅防止内存泄露有意义,需要根据自己的业务设置
env: {
NODE_ENV: 'production',
HOST: '0.0.0.0',
PORT: 65534
},
exec_mode: 'cluster', // 开启多线程模式,用于负载均衡
instances: 'max', // 启用多少个实例,可用于负载均衡
autorestart: true // 程序崩溃后自动重启
}]
};

View File

@ -1,4 +1,9 @@
#!/bin/bash
yarn run build
rsync -avr --delete-after --exclude ".git" . root@manage.wyr.me:/root/blog-client
ssh root@manage.wyr.me 'pm restart blog-client'
rsync -avr --delete-after --exclude ".git" --exclude "node_modules" . root@manage.wyr.me:/root/blog-client
ssh -t -t root@manage.wyr.me << remotessh
source /root/.bashrc
cd /root/blog-client
yarn && pm2 restart blog-client && exit
remotessh