Anyone have an idea what I'm doing wrong here?

gist.github.com/pganssle/31a89

I can't seem to get a minimal docker-compose configuration to expose nginx outside of the container.

(Note, replace _ with / in the file names of the gist).

@pganssle yup I can help you.. your binding to localhost in container, you can not expose localhost bindings using the normal network driver.. your choices are:

1) Bind to 0.0.0.0 in your nginx
2) bind the container to your hosts network stack directly.

@pganssle wait nevermind your nginx config does appear to be binding to *.... but your curling localhost to test... you still have to curl the exposed IP not local host to make sure its a valid test. Containers dont expose localhost ports.

@freemo How do I know what the exposed IP is? I've tried curling the IP of this machine from another machine and I get the same thing.

Follow

@pganssle doing it from an outside box wont help you... the issue is inside the container.. so how to get the correct ip to bind to is a bit of a PITA... on windows there is a special evironment variable you can use but it isnt supported on linux. So what I do is I recreate it, let me find that script where I do it.

Sign in to participate in the conversation
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.