This example uses dnsdocker to discover other nodes and setup a multi-master cluster.
Build the ejabberd cluster image:
git clone https://github.com/rroemhild/docker-ejabberd.git
cd docker-ejabberd/examples/docker-compose-cluster
docker-compose buildStart dnsdocker and the first ejabberd node:
docker-compose up -dWait until the first ejabberd node is up and running docker-compose logs ejabberd, then add some ejabberd nodes to the cluster:
docker-compose scale ejabberd=4