Deployment
Deployment Methods
There are so many ways of deployment that I cannot cover all of them.
With a VM
Here are a few videos I made to explain how to deploy web app on AWS EC2 (VM). Load Balancer service is used for SSL certificate.
This method is not recommended, but it gives you an idea of the old way and how things work.
Load Balancer is expensive and redundant for a small project.
- Deploy Nodejs Web app on AWS EC2 with SSL certificate
- AWS EC2, serve website and force redirect http to https
- Deploy React App To A Regular Server (AWS EC2)
BaaS / PaaS
Read more about BaaS (Backend as a Service) / PaaS (Platform as a Service) here.
Basically you leave everything to some cloud. All you need to do it to upload the content.
SSL certificate is taken care of, so not much to worry about.
Usually, you can choose to use CLI to manually deploy, or use CICD to deploy automatically when triggered (usually a push or release).
- Netlify
- Vercel
- Heroku
- Firebase Hosting
- GCP App Engine and doc
- My Notes
- You pretty much just need to run
gcloud app deploy
to deploy an app that can run fine locally
- GCP Cloud Run and doc
- Can be easily deployed with
gcloud run deploy
- Successor of App Engine
- Not only supports standard language deployments, but also Docker deployment
- Can be easily deployed with
Reverse Proxy
Nginx (Reverse Proxy) + Certbot (SSL)
Read Reverse Proxy for what it is.
We can use Nginx as reverse proxy to direct traffic from client to backend; but the main purpose of using Nginx as a reverse proxy here is to have a easy way of setting up SSL certificate, to support HTTPS.
Certbot has nginx plugin for easy SSL deployment with letsencrypt.