At work I’m the black sheep running Windows when all my colleagues are using Mac or Ubuntu. One thing that they do in their dev machine docker-compose configs doesn’t work under Windows:
ports: - "127.0.0.1:80:80" - "127.0.0.1:443:443"
The purpose of adding the IP to the ports is, as far as I understand it, to limit access to these ports to only the host machine, preventing the local dev apache server from being exposed to the public if you connect your wifi to an untrusted network. And that’s the effect I’m looking for, only exposing the apache running in my container to the windows host, it’s a development environment and that’s all I need. That and security.
How would I accomplish this on Windows? I’ve tried binding to both 127.0.0.1 and 10.0.75.1. In both cases the web server becomes unreachable from the host. (it only works as long as I specify no IP at all)
I’ve also tried to search for a solution online but I may be using the wrong keywords, because I haven’t found anything that addresses this particular situation.