diff options
| author | Pitu <[email protected]> | 2019-03-12 04:45:47 +0000 |
|---|---|---|
| committer | Pitu <[email protected]> | 2019-03-12 04:45:47 +0000 |
| commit | 390eeb9b0718f6736600cbfa47d3d2983cde01d9 (patch) | |
| tree | 0e0d798a3cec0a36b44ea5050a76a799c7d92727 | |
| parent | Merge branch 'dev' of github.com:WeebDev/lolisafe into dev (diff) | |
| download | host.fuwn.me-390eeb9b0718f6736600cbfa47d3d2983cde01d9.tar.xz host.fuwn.me-390eeb9b0718f6736600cbfa47d3d2983cde01d9.zip | |
Automated pm2 process spawn
| -rw-r--r-- | README.md | 9 | ||||
| -rw-r--r-- | docs/pm2.md | 6 | ||||
| -rw-r--r-- | pm2.json | 26 |
3 files changed, 32 insertions, 9 deletions
@@ -25,13 +25,10 @@ This guide asumes a lot of things, including that you know your way around linux Lolisafe is now installed, configured and ready. Now you need to serve it to the public by using a domain name. 6. Check the [nginx](docs/nginx.md) file for a sample configuration that has every step to run lolisafe securely on production. -7. After you finish setting up nginx, you need to start lolisafe by using pm2. If you want to use something else, figure out how. Run the following commands: -```bash -pm2 start npm --name "lolisafe.api" -- run api -pm2 start npm --name "lolisafe.site" -- run site -``` -(More info on why pm2 [here](docs/pm2.md)) +After you finish setting up nginx, you need to start lolisafe by using pm2. If you want to use something else, figure out how. (More info on why pm2 [here](docs/pm2.md)) + +7. Run `pm2 start pm2.json`: 8. Profit ### Cloudflare diff --git a/docs/pm2.md b/docs/pm2.md index 53fc5b0..ac942fc 100644 --- a/docs/pm2.md +++ b/docs/pm2.md @@ -4,8 +4,8 @@ The best way to keep the service running in case of crashes or unexpected issues The recommended way to set it up is to run the commands below, one for the API and the other for the site. ``` -pm2 start npm --name "lolisafe.api" -- run api -pm2 start npm --name "lolisafe.site" -- run site +pm2 start npm --name "lolisafe-api" -- run api +pm2 start npm --name "lolisafe-site" -- run site ``` -All set, if you want to check the logs you can `pm2 logs lolisafe.api` or similar. +All set, if you want to check the logs you can `pm2 logs lolisafe-api` or similar. diff --git a/pm2.json b/pm2.json new file mode 100644 index 0000000..3be4f86 --- /dev/null +++ b/pm2.json @@ -0,0 +1,26 @@ +{ + "apps" : [ + { + "name": "lolisafe-api", + "script": "npm", + "args": "run api", + "env": { + "NODE_ENV": "production" + }, + "env_production" : { + "NODE_ENV": "production" + } + }, + { + "name": "lolisafe-website", + "script": "npm", + "args": "run site", + "env": { + "NODE_ENV": "production" + }, + "env_production" : { + "NODE_ENV": "production" + } + } + ] +} |