Im Trying to deploy a system using docker compose which contains mysql server. The server is shared between the docker containers in the same network.
I need to access the mysql db from a specific external server in our network, so i published the mysql port (3306) within the docker compose file.
But as a security concern I wan to block any other ip who tries to access this port.
I tried many iptables rules and all of them either blocked containers within the docker-compose or allowed other servers to access the port.
p.s. I will all change the user permissions within the mysql server, but blocking the port is the first thing we want to do.