There is a docker, there is a container with proftpd. The ftp daemon is configured to work in passive mode, the launch of the container is configured with docker-compose in which port forwarding is configured from the host machine. When working in the passive mode (if ftp is behind NAT), you need to specify the external IP of the host machine in the config file in the MasqueradeAddress variable.
The problem is that it is not known in advance where this container will be launched, and how many external IP addresses will be on the host machine. How to be?