How to set druid host property in Docker Swarm

If I set the environment variable using druid_host in docker compose it just distributes the property “druid.host” with the ip of the Master server.

How to pass the property in a way that all the services pick up the ip of the host on which they are running.