Skip to content

Latest commit

 

History

History
69 lines (49 loc) · 1.4 KB

Deployment.md

File metadata and controls

69 lines (49 loc) · 1.4 KB

React Deployment

Install Node LTS Version via nvm

Install nvm

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

Install node

nvm install lts/*
Install tool for deployment

PM2 - Production process manager for Node.js

npm install -g pm2

vercel/serve - Static file serving and directory listing

npm install -g serve

nginx - Static file serving and directory listing

sudo apt update
sudo apt install nginx

NextJs (coming soon...)
pm2 start yarn --name nextjs-project -- start [-p <port>]
# static export
pm2 start yarn --name next-export -- serve <export outDir> -l <port>

Not finished, I will write more...

ViteJs
pm2 start --spa --name vite-project <build outDir> <port>

Not finished, I will write more...

Config nginx
More source