With the new exciting Docker Swarm in 1.12 it seems quite possible to deploy multiple applications in a cluster of servers.
I'm looking for a way to deploy two separate applications or application entrypoints on the same port and same cluster. Consider the following:
web.myservice.com:80 -> Swarm -> Service[web] -> web.1
-> web.2
-> web.3
backend.myservice.com:80 -> Swarm -> Service[backend] -> backend.1
-> backend.2
-> backend.3
Where the swarm in this case in only one cluster of multiple hosts, exposing port 80. I suppose you could expose different ports and have load balancers set up to proxy_pass to this other port, but I would say it would be great to have a possibility to just expose hostname:port in the cluster, so if a request comes in on a hostname and port it will be forwarded. If you need multiple hosts or port you can expose several.
This might be available, and this is why I ask this question. Maybe it can be replicated with some advanced config of a HAProxy or Nginx. I have experimented quite some, and found it quite hard to make this extensible. Please advice on the topic if you have any comments or suggestions!
-- Marcus