Title
a

amann

10/16/2017, 2:38 PM
I’m using the new local docker workflow, but am trying to connect from my graphcool docker container to a webserver on my host machine through
localhost
(that I am using for webhooks), does anyone know what the configuration would look like to do this?
d

dpetrick

10/16/2017, 2:58 PM
First you’d have to make sure to bind your webserver in a way that it is accessible outside of
localhost
. Why? Because
localhost
inside of a docker container means the localhost on the container. You then need to use an IP/domain that allows your webhook to go against your server. Concretely, if you bind your server to
0.0.0.0:8080
then your webhook could to go against
<your machine IP, e.g. 192.168.1.2>:8080
.
I should say that webhooks are executed in the docker container, hence the workaround.
a

amann

10/16/2017, 3:43 PM
Right
I am using Docker for Mac, and I have tried to use
docker.for.mac.localhost
, but was unsuccessful
Is there a way to get the host machine ip from inside the docker container?
d

dpetrick

10/16/2017, 3:53 PM
docker.for.mac.localhost
is in theory your best bet, however, as this doesn’t work, you might be better off just hardcoding your IP in the webhook for now. I will look into improving these scenarios for the local docker workflow in a bit.