Access Docker Container from Google Cloud

1.3k views Asked by At

I'm running Docker containers on a Google Cloud instance using Docker Compose. Here is the instance:

enter image description here

And here are the containers running:

$ docker-compose up -d db graphql api
Creating mobydq-db ... done
Creating mobydq-graphql ... done
Creating mobydq-api     ... done

$ docker ps -a
CONTAINER ID        IMAGE                   COMMAND                  CREATED             STATUS              PORTS                              NAMES
05dae8c9340d        mobydq-api              "flask run --host=0.…"   5 seconds ago       Up 4 seconds        0.0.0.0:5434->5434/tcp             mobydq-api
30d6b7a6725e        graphile/postgraphile   "postgraphile -n 0.0…"   6 seconds ago       Up 5 seconds        5000/tcp, 0.0.0.0:5433->5433/tcp   mobydq-graphql
85c4e42e27fd        mobydq-db               "docker-entrypoint.s…"   6 seconds ago       Up 5 seconds        5432/tcp                           mobydq-db

Two of these containers are supposed to be reachable at the following addresses:

I also have firewall rules configured to ensure these ports are accessible from the internet:

enter image description here

Still, I'm unable to reach the two pages above from my browser. What am I missing?

1

There are 1 answers

0
Alexis.Rolland On BEST ANSWER

I was installing my application in the Google Cloud Shell (1) instead of doing it on a Shell session connected to my VM instance (2).

enter image description here