0.0.0.0 means the built-in PHP server running inside sail's docker instance will serve requests for any IP bound to the server.
The docker instance usually is available to your network on a different IP, so in your docker file the port 80 from your local machine is bound to the port 80 of the docker machine.
Therefore when you type 127.0.0.1:
- your browser sends a request to the local port 80 on your machine
- your machine's port 80 is bound to the docker instance's port 80, but in a different local IP
- due to the bounding the request is passed to the docker instance
- as the PHP web server is running to accept requests for any IP's bound to this server it accepts and handle the request.
Image this, on a server with multiple network interfaces, it will have multiple IP addresses bound to it. You can configure a webserver to respond only to one of these IPs and have different web applications served from the same server. By binding the webserver to the 0.0.0.0 address you are telling the webserver to respond requests from any of the bound requests.