«   2019/12   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
Archives
Today
9
Total
1,235,464
안정적인 DNS서비스 DNSEver
관리 메뉴

Blue Breeze

pm2 npm start 본문

Language/Node.js

pm2 npm start

푸른바람 C/H 2019. 11. 14. 13:53

Run pm2 npm

pm2 start npm -- start

ecosystem.config.js

module.exports = {
	apps: [{
		name: "utilservice",
		script: "./bin/www",
		instanses: "max",
		exec_mode: "cluster",
		env: {
			NODE_ENV: "production"
		},
		log_date_format: "YYYY-MM-DD HH:mm:ss.SSS",
		error_file: "./logs/pm2-err.log",
		out_file: "./logs/pm2-out.log",
		combine_logs: true,
		merge_logs: true
	}]
}

package.json

{
"name: "app_name",
"script": {
    "start": "NODE_ENV=production node ./bin/www --app_name &",
    "pm2": "NODE_ENV=production pm2 start --name app_name ./bin/www --log-date-format 'DD-MM HH:mm:ss.SSS' -i max",
    "eco": "NODE_ENV=production pm2 start ecosystem.josn.js",
    "stop": "ps aux | grep app_name | grep -v grep | awk '{print $2}' | xargs kill -9",
    "dev": "DEBUG=* NODE_ENV=development node ./bin/www --app_name --inspect --watch &",
    "ps": "ps aux | grep app_name | grep -v grep"
  }
}

Run Command

npm start pm2
npm start echo

'Language > Node.js' 카테고리의 다른 글

linux watcher limit on pm2  (0) 2019.11.21
pm2 npm start  (0) 2019.11.14
NPM Permission Error  (0) 2019.11.13
jwtwebtoken  (0) 2019.04.12
Origin Policy Error on Sailsjs  (0) 2019.03.20
not support route and folder fot sails.js  (0) 2019.03.04
0 Comments
댓글쓰기 폼