Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # start PM2 tanpa file ecosystem
- pm2 start bin/www -i max --log-date-format "DD-MM-YY HH:mm:ss.SSS"
- pm2 status
- # menjalankan ulang pm2
- pm2 stop all
- pm2 kill
- pm2 start bin/www -i max --log-date-format "DD-MM-YY HH:mm:ss.SSS"
- pm2 status
-
- # mengatasi dot env tidak terbaca
- # The solution was easy. You have to declar cwd, aka the project folder where the dotenv/config will be read from.
- module.exports = {
- apps: [{
- name: 'app1 name',
- script: 'app1.js',
- cwd: '/path/to/folder/',
- exec_mode: 'fork_mode',
- node_args: '-r dotenv/config',
- }, {
- name: 'app2 name',
- script: 'app2.js',
- cwd: '/path/to/folder/',
- instances: 'max',
- exec_mode: 'cluster',
- node_args: '-r dotenv/config',
- }],
- };
Add Comment
Please, Sign In to add comment