I've a docker host & mariadb container in it and I want to apply a replication between this container and another server on another provider
using the following example below I was able to connect remotely to the container but the port is open to the world which I don't recommend
here is my docker-compose.yml file :
db02:
build: .
dockerfile: db02/Dockerfile
container_name: db02
dns:
- 8.8.8.8
- 8.8.4.4
hostname: db02.local
env_file:
- db02/env
ports:
- "3306:3306"
my question is how do I open mysql port to one ip & block it for all others , is there any thing like allow / deny in docker-compose?