doc: refactor doc/deployment-with-pm2.md

This commit is contained in:
dancingCycle 2023-11-07 23:06:39 +01:00
parent fb8722dfda
commit 4ae1fa270a
1 changed files with 1 additions and 29 deletions

View File

@ -36,35 +36,7 @@ NODE_ENV=<node environment mode>
PORT=<port offering this service>
```
* create group and user <service name>
like this [setup](https://github.com/Software-Ingenieur-Begerad/setup/blob/main/doc/grp-usr.md)
* adjust group and user privileges
```
sudo chown -R <service name>:<service name> /opt/<archive name>
```
* prepare pm2 like this [setup](https://github.com/Software-Ingenieur-Begerad/setup/blob/main/doc/pm2.md)
* start the service as npm start script with PM2
```
cd /opt/<archive name>
pm2 start --name <archive name> npm -- start --watch
```
* register/save the current list of processes you want to manage using PM2 so that they will re-spawn at system boot (every time it is expected or an unexpected server restart)
```
pm2 save
```
* restart your system, and check if all the serviceis running under PM2
```
pm2 ls
```
or
```
pm2 status
```
* setup pm2 like [this](https://git.wtf-eg.de/dancesWithCycles/setup/src/branch/main/doc/pm2.md)
* configure web server as proxy for instance with this
[example](../etc/apache2/sites-available/example.conf)