title: docker deploy won't publish port in swarm
body: <p>I've got a swarm set up with a two nodes, one manager and one worker. I'd like to have a port published in the swarm so I can access my applications and I wonder how I achieve this.</p>
  
  <pre><code>version: '2'
  services:
    server:
      build: .
      image: my-hub.company.com/application/server:latest
      ports:
        - "80:80"
  </code></pre>
  
  <p>This exposes port 80 when I run docker-compose up and it works just fine, however when I run a bundled deploy</p>
  
  <pre><code>docker deploy my-service
  </code></pre>
  
  <p>This won't publish the port, so it just says 80/tcp in docker ps, instead of pointing on a port. Maybe this is because I need to attach a load balancer or run some fancy command or maybe add another layer of config to actually expose this port in a multi-host swarm.</p>
  
  <p>Can someone help me understand what I need to configure/do to make this expose a port.</p>
  
  <p>My best case scenario would be that port 80 is exposed, and if I access it from different hostnames it will send me to different applications.</p>
  
  <p>Update:
  It seems to work if I run the following commands after deploying the application</p>
  
  <pre><code>docker service update -p 80:80 my-service_server
  docker kill &lt;my-service_server id&gt;
  </code></pre>
  
  <p>I found this repository for running a HA proxy, it seems great and is supported by docker themselves, however I cannot seem to apply this separate to my services using the new swarm mode. </p>
  
  <p><a href="https://github.com/docker/dockercloud-haproxy" rel="noreferrer">https://github.com/docker/dockercloud-haproxy</a></p>
  
  <p>There's a nice description in the bottom describing how the network should look:</p>
  
  <pre><code>Internet -&gt; HAProxy -&gt; Service_A -&gt; Container A
  </code></pre>
  
  <p>However I cannot find a way to link services through the docker service create command, optimally now looks like a way to set up a network, and when I apply this network on a service it will pick it up in the HAProxy.</p>
  
  <p>-- Marcus</p>