Giter VIP home page Giter VIP logo

next-learn-basics-demo's Introduction

Some Node.js sample for future me to run on VM.

Run Next.js demo page on Google Cloud Platform (GCP) virtual machine (VM).

Just:

git clone https://github.com/linas-p/next-learn-basics-demo

cd next-learn-basics-demo

./script_page.sh

Steps:

  1. Create VM on GCP

  2. Install new Nodejs (remove old if exist):

     cd /etc/apt/sources.list.d
     sudo rm nodesource.list
    
     sudo apt --fix-broken install
     sudo apt remove nodejs libnode-dev libnode72
     sudo apt remove nodejs-doc
    
     curl -sL https://deb.nodesource.com/setup_18.x | sudo bash -
     sudo apt update
     sudo apt-get install nginx nodejs git vim 
    
  3. Prep nginx:

     NGINX_='server {
         listen 80;
         client_max_body_size 10M;
         server_name YourWebsiteNameWithDomain yourIPV4;
         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;
         }
     }' 
    
     echo $NGINX_ | sudo tee /etc/nginx/sites-available/default
    
     sudo nginx -t 
     sudo systemctl restart nginx
    
  4. Build some demo page:

     npm install next start 
     # npm install @emotion/server @mui/icons-material # additional if needed
     npm run build 
    
  5. Run and deatach:

     screen -S start_session
     npm run start 
     <ctrl>+a+d
    
  6. Check VM global IP

next-learn-basics-demo's People

Contributors

linas-p avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.