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

comments

BehindTheMath

One option is to use Docker Compose with a CI/CD pipeline. First create container images and a Docker Compose setup. Then set up a CO/CD pipeline that will build the images, SSH into the VM and push the changes, and then restart the server.

Abother option is to use Dokku, where you just push to a Git remote and everything is built and set up.

You can also use App Engine or Cloud Run, which might be simpler.

NetFutility [OP]

Are there any ci/cd pipelines you'd recommend? I'm currently using private github repo

BehindTheMath

You can use Github Actions.