Automated pm2 process spawn
This commit is contained in:
parent
6aee90e375
commit
390eeb9b07
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue