Created
June 11, 2019 22:32
-
-
Save normancarcamo/7874c4724bd7c2a47acea2f59254d084 to your computer and use it in GitHub Desktop.
Ejemplo de PM2 config file en js.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const pkg = require('package.json'); | |
module.exports = { | |
apps : [{ | |
name : pkg.name, | |
script : 'dist/index.js', | |
output : 'logs/out/logs.log', | |
error : 'logs/err/logs.log', | |
log : 'logs/all/logs.log', | |
instances : 0, | |
exec_mode : 'cluster', | |
restart_delay : 1500, | |
wait_ready : true, | |
listen_timeout : 3000, | |
merge_logs : true, | |
env_staging : { | |
NODE_ENV : 'production', | |
LOG_LEVEL : 'info', | |
APP_NAME : pkg.name, | |
SERVER_PORT : 3000, | |
SERVER_IP : '192.168.0.11' | |
}, | |
env_production : { | |
NODE_ENV : 'production', | |
LOG_LEVEL : 'info', | |
APP_NAME : pkg.name, | |
SERVER_PORT : 3000, | |
SERVER_IP : '192.168.0.10' | |
} | |
}], | |
deploy : { | |
staging : { | |
host : [ 'virtual.staging' ], | |
user : 'deploy', | |
ref : 'origin/master', | |
repo : `git@virtual.services:/srv/git/${pkg.name}.git`, | |
path : `/srv/www/${pkg.name}`, | |
"post-setup" : 'bash deploy.sh staging setup', | |
"post-deploy" : 'bash deploy.sh staging update' | |
}, | |
production : { | |
host : [ 'virtual.production' ], | |
user : 'deploy', | |
ref : 'origin/master', | |
repo : `git@virtual.services:/srv/git/${pkg.name}.git`, | |
path : `/srv/www/${pkg.name}`, | |
"post-setup" : 'bash deploy.sh production setup', | |
"post-deploy" : 'bash deploy.sh production update' | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment