1

I've developed a simple node.js application which lives in a customized Docker container (based on the node:carbon image).

The docker run command is:

docker run -p 8087:8087 --restart=on-failure -t --name=$RUN_NAME \ 
--env-file $DEV_ENV -d $CONTAINER_NAME:$CONTAINER_TAG

My webserver should be responding on port 8087 and it is from inside the container and from outside the vm by calling it from some other servers (not in Google Cloud).

My problem is that I should call it from my GoDaddy Linux hosting (curl call) and it's not reachable from there:

* About to connect() to x.x.x.x port 8087 (#0)
* Trying x.x.x.x... Connection refused
* couldn't connect to host
* Closing connection #0

curl: (7) couldn't connect to host

Note: I've opened the firewall for the 8087 port.

Please help

xavbeta
  • 13
  • 3
  • Have you bind your container port to the host?. If not, as per [this](https://docs.docker.com/engine/userguide/networking/default_network/binding/) document, the docker container need to binds its port with host. There is this simplified explanation provided [here](https://bobcares.com/blog/docker-port-expose/). I can see a similar issue [here](https://stackoverflow.com/questions/28403341/boot2docker-access-webserver-as-localhost) as well. – Digil Jan 13 '18 at 03:53
  • Yes I did but thanks for pointing it out! I've updated my answer. – xavbeta Jan 14 '18 at 10:19

1 Answers1

1

Since you say that you've checked from other external hosts, have you considered that GoDaddy might be blocking outbound traffic to port 8087 (possibly due to port-scanning or other bad behavior)?

You should be able to rule this out by starting a service on 8087 on a non GCP VM, and testing whether curl from GoDaddy is able to reach it.

Right now, from your description, it sounds like:

VM -> localhost -> VM : works External -> internet -> VM: works GoDaddy -> internet -> VM: fails

If other external hosts work, I'd start to suspect GoDaddy, assuming that you've ensured that your firewall rule is actually open to 0.0.0.0/0 and not some smaller subnet.

E. Anderson
  • 3,405
  • 1
  • 16
  • 19
  • Your last conjecture is true: I've found out that GoDaddy's firewall allows only a few outbound ports. Their HelpDesk suggested using the 443 port... – xavbeta Jan 29 '18 at 14:31