Looking at most docker containers, the specified port will include both incoming as well as external traffic. For instance “portainer”, the WebUI port is the port where you can reach the web interface and that is interactive so both incoming and outgoing?
You may find this posting interesting, because it discusses different routing for incoming and outgoing traffic Apps and Custom Routing 25.04