A Container Port and a Host Port
Retrospective web development exercise for the 2019 archive.
A local web server inside a container may listen on port 80 while your browser uses 8080. A mapping such as 127.0.0.1:8080:80 publishes the container’s port 80 on the host’s loopback address at port 8080.
Start a small test service with that mapping. Confirm that the browser on the host can open http://127.0.0.1:8080/. If a second Compose service needs to reach it over the shared network, use the service name and port 80 from that container. The same server has two useful addresses depending on where the request starts.