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 oh i see, i need to move it -- one sec.
@pganssle does it help if you remove this from the docker-compose.yml?
command: "nginx"
This adapted version seems to be working for me?
@edsu Interesting. I sorted it out by adding `daemon off` to the config: https://qoto.org/@pganssle/106794915957856274
Do you know why that worked?
When the daemon is on then the call to nginx command returns immediately and it spawns in the background. This was causing your container to exit when nginx returned.
So the reason your curl statement wasnt working was because your container wasnt running when you tried it.
The stuff i was saying about binding to localhost is generally still true, but it appears you were correctly binding nginx to the wildcard IP and not exclusive to localhost. Keep this in mind for your future debugging so you dont use localhost in the future when debugging inside the container (which wasnt helpful)
@pganssle I downloaded the zip though.