I can do this successfully:
- Bundle my app into a docker image
- Build this image into a container using Google Cloud Build upon push to master
- (This container is stored in the registry at, for example,
gcr.io/my-project/my-container)
- (This container is stored in the registry at, for example,
- Deply this container to the web using Google Cloud Run
- Visit the Cloud Run url and see my website
I am now trying more sophisticated builds and I think the next step is to use Google Compute Engine.
To start, I am simply trying to deploy a single instance of the same app that I deployed to Cloud Run:
- Navigate to
Compute Engine > VM Instances - Enter basics like instance name
- Enter my container location under "Container Image":
gcr.io/my-project/my-container- (As an aside, I find it suspect that the interface does not offer a selector for your existing Container Registry items here.)
- Select "Allow HTTP Traffic" and "Allow HTTPS Traffic"
- Click "Create"
GCE takes a minute to create it, and then it shows the green checkmark and the instance name, and "External IP: 35.238.xxx.xxx". I visit that URL in my browser and get... "35.238.xxx.xxx refused to connect."
To inspect, I go back to the GCE page and select "SSH > Open in browser window" next to my instance, which opens a type of cloud terminal to the machine.
In this terminal window, type ps and see that no processes are running. The container Dockerfile ends with CMD yarn start:prod, so I guess that's not happening here.
Further, I ls here and there and navigate around, and see that there is no /app directory from my Dockerfile's WORKDIR /app command. It seems like not only did my app not boot, but was the container not copied to the VM instance?
What am I doing wrong?