Last active
June 28, 2020 00:30
-
-
Save endel/83a6613b067b846a81384c517989868a to your computer and use it in GitHub Desktop.
Sample PM2 ecosystem file for deployment
This file contains hidden or 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
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 : '[email protected]: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