1

I have my Docker container running on GCP Compute Engine. The CE server is running on CentOS 7. My Docker container has the application being served by Nginx with port 80 exposed. For some reason, I can't access it from the external IP address on my browser. I ran the container with this command:

sudo docker run --name myapp -p 80:80 -d myapp:1.0.0

When I do sudo curl <internal_ip>:80 or sudo curl <localhost>:80 it will show that the application is running and returns back the content, but if I try to access in my browser with <external_ip>:80, it doesn't load anything. What can I do to make this accessible through the external IP address?

azdiiv
  • 383
  • 5
  • 17
  • 2
    is port 80 opened on the instance? (see https://stackoverflow.com/questions/21065922/how-to-open-a-specific-port-such-as-9090-in-google-compute-engine) – lvthillo May 27 '19 at 18:50
  • 2
    Did you set up the firewall? https://cloud.google.com/vpc/docs/special-configurations#externalhttpconnection – Cloud Ace Wenyuan Jiang May 28 '19 at 00:08
  • Ahh, yeah that seemed to be the reason why it wasn't working, thank you guys for the help! :) – azdiiv May 28 '19 at 02:13

1 Answers1

1

It seems I had to configure the firewall to open up port 80.

azdiiv
  • 383
  • 5
  • 17