Help deploying to compute engine instance
I have a react and express app that I want to deploy to my e2-micro instance. Currently I'm going in there and installing nginx and then gcloud scp my files over. I know I can use terraform to spin up the instance and use tpl to setup and configure my nginx but how are ppl deploying their react builds and express api and set up pm2 to manage the express api?
8 comments · 100% upvoted · other discussions
You can create an VM instance running container-optimized OS (COS) and attach a docker container to it.
A little more complex: Create an instance template (also running COS) and create a managed instance group from that template. You can also autoscale the managed instance group based on ingress, CPU or RAM usage.
Cloud run might be an alternative as well that is easy to setup (no Terraform required for this, just a cloudbuild.yaml).