A container has its own network environment. Publishing a port connects a host listener to a container port using host:container order. If the web server listens on 80 inside the container and the preview should open on 8100, publish 8100:80. The image can document a port with EXPOSE, but that instruction doesn't create a host listener. Also check for an occupied host port before starting another service. The tasks keep the application port fixed while the requested host listener changes. A reversed mapping can be syntactically valid and still send requests to a port where nothing listens.