title: Docker Swarm HAProxy Not Load Balancing w/ Overlay Networking
body: <p>I have spent the past few day working on creating a docker swarm on Digtital Ocean. Note: I don't want to use <code>-link</code> to communicate with the other apps/containers becasue they are technically considered deprecated and don't work well with docker swarm (i.e. I can't add more app instances to the load balancer without re composing the entire swarm)</p>
  
  <p>I am using one server as a kv-store server running console according to <a href="https://docs.docker.com/engine/userguide/networking/get-started-overlay/">this guide</a>. Becasue i'm on Digital Ocean, i'm using private networking on DO so the machines can communicate with each other.</p>
  
  <p>I then create a hive master and slave, and start the overlay network, which is running on all machines. Here is my docker-compose.yml</p>
  
  <pre><code>proxy:
      image: tutum/haproxy 
      ports:
          - "1936:1936"
          - "80:80"
  
  web:
      image: tutum/hello-world
      expose:
          - "80"
  </code></pre>
  
  <p>So when I do this it creates the 2 containers. HAProxy is running because I can access the stats at port 1936 at <code>http://&lt;ip-address&gt;:1936</code>, however, when I try to go to the web server/load balancer at port 80 I get connection refused. I everything <em>seems</em> to be connected though, when I run <code>docker-compose ps</code>:</p>
  
  <pre><code>       Name                      Command               State                                 Ports
  --------------------------------------------------------------------------------------------------------------------------------
  splashcloud_proxy_1   python /haproxy/main.py          Up      104.236.109.58:1936-&gt;1936/tcp, 443/tcp, 104.236.109.58:80-&gt;80/tcp
  splashcloud_web_1     /bin/sh -c php-fpm -d vari ...   Up      80/tcp
  </code></pre>
  
  <p>The only thing I can think of is that it's not linking to the web container, but i'm not sure how to troubleshoot this.</p>
  
  <p>I'd appreciate any help on this.</p>