Skip to content

Instantly share code, notes, and snippets.

@endel
Last active June 28, 2020 00:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save endel/83a6613b067b846a81384c517989868a to your computer and use it in GitHub Desktop.
Save endel/83a6613b067b846a81384c517989868a to your computer and use it in GitHub Desktop.
Sample PM2 ecosystem file for deployment
module.exports = {
apps : [{
name : 'my-app',
script : 'lib/index.js',
watch : false,
instances : 1,
exec_mode : 'fork',
env: {
NODE_ENV: 'development'
}
}],
deploy : {
production : {
user : 'root',
host : [ 'x.x.x.x' ],
ref : 'origin/master',
repo : 'git@github.com:endel/my-repo.git',
path : '/root/my-app',
'post-deploy' : 'npm install && npx tsc && pm2 startOrRestart ecosystem.config.js --env production'
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment