Iptables block container ports

Hello,

I have a web server running docker with Apache, Mysql and MongoDB inside the container.

What I need to do is the following:
Apache (80) It is released for all types of connections.
MySQL (3306) and MongoDB (27017) should be available only for DBAs with ip released in iptables
In my attempts it didn’t work very well.
Because sometimes it blocked everything or released everything.

I need the container to be able to go out to the internet.
my iptables

My rules

iptables -F INPUT
iptables -F OUTPUT
iptables -F FORWARD

iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT

iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -m state --state RELATED,ESTABLISHED -j ACCEPT


iptables -A INPUT -i lo -j ACCEPT

# LIBERANDO ENCAMINHAMENTOS DO DOCKER
iptables -A FORWARD -j DOCKER-ISOLATION-STAGE-1
iptables -A FORWARD -j DOCKER
iptables -A FORWARD -j DOCKER-USER

Has anyone had this problem and managed to solve it?

Thanks