PM2 project deployment

pm2

npm install pm2 -g
Bahrain have pm2 global command

With npm run way, once stopped, can not be accessed, so the deployment by PM2, the process can be maintained

ON:

PM2 start /bin/www  开启,维持进程

Other commands:

PM2 list
pm2 --help
pm2 stop name
pm2 restart all

plan 1

Before and after the end of the separation deploy static resource deployment to nginx, nodejs deployed to pm2

Scenario 2

Deployed in a front and rear end

// modify the production environment for the dist directory
"build": "webpack --config webpack.config.pro.js "

Production mode to
output to the dist directory
devServer removed
devtool removed

After the run, copy all the files in the dist directory to the back-end public

Ali deployed to the cloud

Download xshell or deployed inside node

Guess you like

Origin www.cnblogs.com/ltfxy/p/12596004.html