Skip to content

Instantly share code, notes, and snippets.

@ygamretuta
Created July 26, 2017 09:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ygamretuta/b89066b1de3f284676ffac6284001675 to your computer and use it in GitHub Desktop.
Save ygamretuta/b89066b1de3f284676ffac6284001675 to your computer and use it in GitHub Desktop.
PM2 create-react-app config
module.exports = {
/**
* Application configuration section
* http://pm2.keymetrics.io/docs/usage/application-declaration/
*/
apps : [
{
name : 'my_react_app',
script : 'npm',
args : 'run start:production',
env_production : {
NODE_ENV: 'production'
}
},
],
/**
* Deployment section
* http://pm2.keymetrics.io/docs/usage/deployment/
*/
deploy : {
production : {},
staging: {
user: 'your-user',
host: 'your-server',
ref: 'origin/master',
repo: 'git@github.com:gituser/yourrepo.git',
path: '/var/www/yourprojectpath',
key: '/absolute/path/to/key',
ssh_options: ['ForwardAgent=yes'],
'post-deploy': 'npm install && pm2 reload ecosystem.config.js --env production'
},
dev : {}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment