Minimizing Exposure
Not every container port needs to be published to the host. Internal services can remain on a private Docker network while only the reverse proxy or application gateway publishes a public port.
Use separate networks for frontend and backend boundaries where appropriate, and avoid exposing databases directly to the public internet.