Anyone have an idea what I'm doing wrong here?
https://gist.github.com/pganssle/31a899ea34d2ecff77034b25e077b600
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.
@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.