Vincent Teyssier
Vincent Teyssier

Reputation: 2217

Expose my docker container to my external IP on GCP

We have a dockerized app that we imported on a Compute Engine instance with ubuntu 16.04. It contains a nginx reverse proxy running on port 80 and in /etc/hosts we've added 127.0.0.1 mydockerizedapp

The GCE got an external IP address. How can I set so that when I go on this external IP from a browser, I see the files served by the container nginx ?

Upvotes: 1

Views: 2346

Answers (1)

Jonathan Muller
Jonathan Muller

Reputation: 7516

You have to expose the ports of your container on the host machine by mapping it.

If you use the cli: --port-mappings=80:80:TCP

Upvotes: 2

Related Questions