You can read scripts that the package.json file in order to know more about it!
npm run dev // run for devnet
Note: Node and nginx system environment are required on the server !
git clone https://github.com/virtualeconomy/go-explorer-frontend.git
cd go-explorer-frontend
npm install
npm run build // build for miannet
npm install pm2 -g // install for global
pm2 start npm --watch --name Explorer -- run start-next 3000 // run by pm2 (default port is 3000)
pm2 list // check out the process info
- Create a nginx file
sudo nano /etc/nginx/sites-available/Explorer
- Copy and paste these configuration
server {
listen 80;
server_name devexplorer.v.systems;
root /home/go-explorer-v2.0/Frontend/vsys-explorer;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
location /api/ {
proxy_pass http://127.0.0.1:9080;
}
}
- Link to the
sites-available
dicrectory
sudo ln -s /etc/nginx/sites-available/Explorer /etc/nginx/sites-enabled
- Test
sudo nginx -t
- Restart Nginx
sudo systemctl restart nginx
git pull // pull the lastest code from Github
npm run build
# Write env in ~/.bashrc or /etc/profile
export DEPLOY_MODE="prod" #or "build-test"
# docker build
docker build \
--platform=linux/amd64 \
-t <your username>/vsys-explorer:frontend \
--build-arg deploy_mode=$DEPLOY_MODE \
-f Dockerfile .
# docker run
docker run -d -p 3000:3000 --name vsys-explorer-frontend <your username>/vsys-explorer:frontend