Skip to content

Instantly share code, notes, and snippets.

@chungquantin
Created January 5, 2021 17:34
Show Gist options
  • Select an option

  • Save chungquantin/af61f5a9170fb157418d8851d03127b6 to your computer and use it in GitHub Desktop.

Select an option

Save chungquantin/af61f5a9170fb157418d8851d03127b6 to your computer and use it in GitHub Desktop.
module.exports = {
apps: [
{
name: "React Typescript GraphQL boilerplate",
script: "src/index.ts",
instances: 2,
cwd: __dirname,
autorestart: true,
max_memory_restart: "1G",
exec_mode: "cluster",
env: {
NODE_ENV: "production",
},
},
],
deploy: {
production: {
host: "xx.yy.zz.vv",
user: "deploy",
ssh_options: ["ForwardAgent=yes"],
ref: "origin/master",
repo: "git@github:repo/repo.git",
path: "/path/to/project",
"post-deploy":
"cd /path/to/project && NODE_ENV=production yarn --production=false;yarn build;pm2 startOrReload ecosystem.config.js",
env: {
NODE_ENV: "production",
},
},
staging: {
user: "deploy",
host: "xx.yy.zz.vv",
ref: "origin/develop",
repo: "git@github.com:repo/repo.git",
path: "/path/to/project",
ssh_options: ["PasswordAuthentication=no", "StrictHostKeyChecking=no"],
"post-deploy":
"cd /path/to/project && yarn --production=false;yarn build;pm2 startOrReload ecosystem.config.js",
env: {
NODE_ENV: "production",
},
},
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment