What is the difference between `-p 80:80` and `-p 127.0.0.1:80:80`?

BeginnerConceptNetworking
Answer

The first binds on all host interfaces (0.0.0.0, and often :: too), exposing the service to the network. The second binds only to loopback, reachable just from the host (or via a reverse proxy/SSH tunnel). For databases and admin UIs always bind to 127.0.0.1.

All Docker questions Roadmap: Docker & containers

More on Networking