This is one of the way for doing this. Have a fixed set of IPs for both host and the containers. Set up a docker network like this with a common IP address.
docker network create -d bridge --subnet 192.168.0.0/24 --gateway 192.168.0.1 dockernet
Now each container can connect to the host under the fixed IP 192.168.0.1.
You just need to make sure, that you connect all your containers to that “dockernet” network you just created. You can do that with the --net=dockernet option for docker run.