'HAProxy config for TCP load balancing in docker container

I'm trying to put a HAProxy loadbalancer in front of my RabbitMQ cluster(which is setup with nodes in separate docker containers). I cannot find many examples for haproxy config for the above setup,

global
        debug
 
defaults
        log     global
        mode    tcp
        timeout connect 5000
        timeout client 50000
        timeout server 50000

frontend main
        bind *:8089
        default_backend app

backend app
        balance roundrobin
        mode http
        server          rabbit-1 172.18.0.2:8084
        server          rabbit-2 172.18.0.3:8085
        server          rabbit-3 172.18.0.4:8086

In this example, what should I give in the place of the ip addresses for docker containers?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source