Docker Community Forums

Share and learn in the Docker community.

Which port docker use to send requests

I am running docker on Linux 18.
I know how -p ports work. I have node application running inside the docker container.
I have MongoDB running inside another container. I can access MongoDB via IP: port from other machines.
but I have disallowed all default incoming requests for security reasons.
I have opened only specific ports.
But problem is this my node application unable to connect MongoDB via Ip:port.
However when i allow all default incoming requests for my server, Node container can connect to database.

My question is this how can my node application connect to MongoDB container without allowing all incoming requests firewall ?