Skip to content

Instantly share code, notes, and snippets.

@DanishSiddiq
Last active September 29, 2018 19:19
Show Gist options
  • Save DanishSiddiq/038030f7fb953589f3d3c5a8dd227698 to your computer and use it in GitHub Desktop.
Save DanishSiddiq/038030f7fb953589f3d3c5a8dd227698 to your computer and use it in GitHub Desktop.
Configuration file for setting up PM2
module.exports = {
apps : [
{
name : 'Custering',
script : 'Clustering/src/app.babel-register.js',
exec_mode : 'cluster_mode',
instances : 'max'
},
{
name : 'Clustering_Replcia',
script : 'ClusteringReplica/src/app.babel-register.js',
exec_mode : 'cluster_mode',
instances : '2'
}
],
deploy : {
production : {
user : 'node',
host : '202.5.1.1',
ref : 'origin/master',
repo : '[email protected]:DanishSiddiq/Clustering.git',
path : '/var/www/production',
'pre-deploy-local' : 'echo \'This is a local executed command\'',
// Commands to be executed on the server after the repo has been cloned
'post-deploy' : 'npm install && pm2 startOrRestart ecosystem.json --env production',
},
staging : {
'user' : 'node',
'host' : '212.83.163.1',
'ref' : 'origin/master',
'repo' : '[email protected]:repo.git',
'path' : '/var/www/development',
'ssh_options': ["StrictHostKeyChecking=no", "PasswordAuthentication=no"],
'post-deploy' : 'pm2 startOrRestart ecosystem.json --env dev',
'env' : {
'NODE_ENV': 'staging'
}
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment