Skip to content

Instantly share code, notes, and snippets.

@pwlin
Created January 1, 2016 22:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save pwlin/c74036e095f687cdd8ac to your computer and use it in GitHub Desktop.
Save pwlin/c74036e095f687cdd8ac to your computer and use it in GitHub Desktop.
PM2 config example
{
"apps" : [{
"name" : "worker-app",
"script" : "worker.js",
"args" : ["--toto=heya coco", "-d", "1"],
"watch" : true,
"node_args" : "--harmony",
"merge_logs" : true,
"cwd" : "/this/is/a/path/to/start/script",
"env": {
"NODE_ENV": "production",
"AWESOME_SERVICE_API_TOKEN": "xxx"
}
},{
"name" : "api-app",
"script" : "api.js",
"instances" : 4,
"exec_mode" : "cluster_mode",
"error_file" : "./examples/child-err.log",
"out_file" : "./examples/child-out.log",
"pid_file" : "./examples/child.pid"
}]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment