{"action":"created","issue":{"url":"https://api.github.com/repos/wellyshen/react-cool-starter/issues/98","repository_url":"https://api.github.com/repos/wellyshen/react-cool-starter","labels_url":"https://api.github.com/repos/wellyshen/react-cool-starter/issues/98/labels{/name}","comments_url":"https://api.github.com/repos/wellyshen/react-cool-starter/issues/98/comments","events_url":"https://api.github.com/repos/wellyshen/react-cool-starter/issues/98/events","html_url":"https://github.com/wellyshen/react-cool-starter/issues/98","id":256478600,"number":98,"title":"How to integrate with PM2?","user":{"login":"jeghers","id":6721949,"avatar_url":"https://avatars1.githubusercontent.com/u/6721949?v=4","gravatar_id":"","url":"https://api.github.com/users/jeghers","html_url":"https://github.com/jeghers","followers_url":"https://api.github.com/users/jeghers/followers","following_url":"https://api.github.com/users/jeghers/following{/other_user}","gists_url":"https://api.github.com/users/jeghers/gists{/gist_id}","starred_url":"https://api.github.com/users/jeghers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeghers/subscriptions","organizations_url":"https://api.github.com/users/jeghers/orgs","repos_url":"https://api.github.com/users/jeghers/repos","events_url":"https://api.github.com/users/jeghers/events{/privacy}","received_events_url":"https://api.github.com/users/jeghers/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-09-10T01:50:51Z","updated_at":"2017-09-15T17:32:44Z","closed_at":null,"author_association":"NONE","body":"Need a good way to run node production mode as a system demon on a Linux server. PM2 looks like a very good way to do this, can you help me figure out and document how to use PM2 in order to make this a standard demon service on a Linux machine?"},"comment":{"url":"https://api.github.com/repos/wellyshen/react-cool-starter/issues/comments/329847937","html_url":"https://github.com/wellyshen/react-cool-starter/issues/98#issuecomment-329847937","issue_url":"https://api.github.com/repos/wellyshen/react-cool-starter/issues/98","id":329847937,"user":{"login":"martin2786","id":2111808,"avatar_url":"https://avatars3.githubusercontent.com/u/2111808?v=4","gravatar_id":"","url":"https://api.github.com/users/martin2786","html_url":"https://github.com/martin2786","followers_url":"https://api.github.com/users/martin2786/followers","following_url":"https://api.github.com/users/martin2786/following{/other_user}","gists_url":"https://api.github.com/users/martin2786/gists{/gist_id}","starred_url":"https://api.github.com/users/martin2786/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martin2786/subscriptions","organizations_url":"https://api.github.com/users/martin2786/orgs","repos_url":"https://api.github.com/users/martin2786/repos","events_url":"https://api.github.com/users/martin2786/events{/privacy}","received_events_url":"https://api.github.com/users/martin2786/received_events","type":"User","site_admin":false},"created_at":"2017-09-15T17:32:44Z","updated_at":"2017-09-15T17:32:44Z","author_association":"NONE","body":"Hi @elrumordelaluz to run the starter with pm2 you need to do the following:\r\n\r\n- Install pm2 globally: npm i pm2 -g \r\n- on the starter folder create a pm2 ecosystem (this will contain all the config for pm2) with: pm2 ecosystem\r\n- change the ecosystem file created to contain something like this:\r\nmodule.exports = {\r\n  apps : [\r\n\r\n    // First application\r\n    {\r\n      name      : 'React Cool Starter',\r\n      script    : 'index.js',\r\n      env: {\r\n        NODE_PATH: \"./src\",\r\n        PORT: 3000\r\n      },\r\n      env_production : {\r\n        NODE_ENV: 'production'\r\n      }\r\n    }],\r\n};\r\n- run pm2 with the ecosystem file: pm2 start ecosystem.config.js\r\n\r\nThis is the basic config for pm2, take a look at pm2 docs to see what else can you add (max memory usage, cluster, etc)\r\n\r\nAbout how to handle env variables, I usually go with this: https://github.com/motdotla/dotenv\r\nbut there are several solutions.\r\n\r\nCheers."}}
{"actor":{"display_login":"martin2786"}}