universelabs / universe

Decentralized private key recovery
https://universe.engineering
MIT License
13 stars 1 forks source link

Understand how to run node.js apps on VM's #56

Closed faddat closed 3 years ago

faddat commented 4 years ago

Description Need to understand how to run node.js (Node, Express, Create-React-App) apps on virtual machine servers using NGINX.

Tutorial list

  1. Deploying a Node App to Digital Ocean (scotch.io)
  2. How To Set Up a Node.js Application for Production on Ubuntu 18.04 (from DigitalOcean)
  3. Start to Finish: Deploying a React App on DigitalOcean
  4. Deploy React.js (create-react-app) Node.js to DigitalOcean Cloud
  5. Simplest Way to Deploy ReactJS Web App to Digital Ocean as Production
  6. Static React app in 20 mins with DigitalOcean.
  7. Deploy a Create-React-App Website to DigitalOcean.

Other for later

Old references (DO NOT WATCH OR READ!)

guylepage3 commented 4 years ago

Slack reference https://universelabs.slack.com/archives/CD22EAGUX/p1570018426019900

Guy Lepage Oct 2nd at 8:13 AM

good morning @faddat

so here’s how you use nginx to run multiple ports on one GCP Compute Engine or Digital Ocean Droplet.

https://hackernoon.com/deploy-react-js-create-react-app-node-js-to-digitalocean-cloud-hosting-72206310017b

"Let me explain to you very simple why we do use Nginx for this Nodejs Web application. Example: Our Chat app when we start it running on port 3000 that is default of Nodejs application running. we can change the port to 3001 or 3002, or 8080 … so if you pointed your domain tabvn.com to Degital Ocean cloud vps so this case we can visit the chat app in http://tabvn.com:3000 so we need just see nodejs web app in default port 80 such at http://tabvn.com , that is why we use Nginx."

So we do not need to remove the express server from universe.engineering

guylepage3 commented 4 years ago

brb.. dog walk.. :)

guylepage3 commented 4 years ago

Start to Finish: Deploying a React App on DigitalOcean

guylepage3 commented 4 years ago

This is an old tutorial. Just posting for reference. I'm not suggesting this is one for us to execute. See "Tutorial list" at top of issue for list to execute.

guylepage3 commented 4 years ago

This tutorial was something @itamarreif posted in Slack in late September.

@faddat, let’s both, you and I, run through this video today as well.

guylepage3 commented 4 years ago

This is an old tutorial. Just posting for reference. I'm not suggesting this is one for us to execute. See "Tutorial list" at top of issue for list to execute.

guylepage3 commented 4 years ago

This is an old tutorial. Just posting for reference. I'm not suggesting this is one for us to execute. See "Tutorial list" at top of issue for list to execute.

faddat commented 4 years ago

@guylepage3 I do not think the one you mentioned as showing how to do multiple ports.... does multiple ports.

https://hackernoon.com/deploy-react-js-create-react-app-node-js-to-digitalocean-cloud-hosting-72206310017b

Shows how to forward a single port using NGINX

guylepage3 commented 4 years ago

Can you provide context? I just numbered the items in the list. @faddat

guylepage3 commented 4 years ago

Did you complete the tutorial 1 in it's entirety @faddat?

guylepage3 commented 4 years ago

Simplest Way to Deploy ReactJS Web App to Digital Ocean as Production

guylepage3 commented 4 years ago

@faddat Once all items in #80 Digital Ocean migration – Critical Path are complete, write up findings and then close this issue. Thx.

guylepage3 commented 4 years ago

Now that we're running micro-services this issue is moot. closing.

faddat commented 4 years ago

Tutorial 1 - scotch.io

Output:

tutorial1@tutorial1:~$ curl localhost:3000
Hey, I'm a Node.js app!tutorial1@tutorial1:~$ 

Tutorial 1 result:

Serving insecurely on port 80

See it here: http://142.93.6.162/

Second time here

faddat commented 4 years ago

Tutorial 2 - DIgital Ocean

https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-18-04

I changed this so that it uses the latest ubuntu. Nginx is up and secured.

root@tutorial2:~# curl localhost:3000
Hello World!

https://tutorial2.universe.engineering

guylepage3 commented 4 years ago

Here's a great visual for Web Server (NGINX) vs. App Server (Node.js/Express.js)

https://medium.com/dev-blogs/multiple-nodejs-apps-on-single-server-47b8bba3ec68

image

faddat commented 4 years ago

Article is dokku propaganda and details routing subdomains to containers automatically with dokku.

guylepage3 commented 4 years ago

Was not referencing the article. Was just showing the "visual" so that you can understand how NGINX fits in with everything.