A web server can be running inside a container while your browser still needs a way to reach it. A port is a number that helps a machine direct incoming network requests to the right service. Docker can publish a host port to pass those requests to a port inside the container.
Docker · Lesson 5
Port Mapping
Learn how to publish a container port and find the address a local browser should use.