Skip to content

Commit

Permalink
Update pm2 deploy instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
matias-lg committed Nov 12, 2023
1 parent fa3f0d5 commit 7723288
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
DEPLOY_USER="john"
DEPLOY_HOST="212.21.212.1"
DEPLOY_PORT="22"
DEPLOY_KEY="~/.ssh/id_rsa"
DEPLOY_PATH="/home/app/"
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,18 @@ npm run start
2. Build the container: `docker build -t er-docker .`.
3. Run the container: `docker run -p 3000:3000 er-docker`.

### With pm2
### Deploy to remote server with pm2
First make sure to add your credentials in a `.env` file.
#### Install pm2
```bash
npm install pm2 -g
```
#### Build the Next.js app
#### Setup remote
```bash
npm run build:next
```
#### Start the node.js server with pm2
pm2 deploy pm2.config.js production setup
```
pm2 start pm2.config.js

#### Deploy
```bash
pm2 deploy pm2.config.js production
```

0 comments on commit 7723288

Please sign in to comment.