How do I share a cloud node among different Web apps hosted through Docker?

Psycho Punch asked:

I want to have multiple Web apps hosted on the same cloud node running as separate Docker containers. The Docker setup actually isn’t much of the problem for me, but the fact that only one of the Web applications can be bound to port 80, to which I have my registered domain mapped. If I’m not mistaken, there’s no way to map (sub)domains to particular port, so I’m wondering how people work around this.

My answer:

The thing I see most commonly done in this circumstance is using jwilder/nginx-proxy to handle all incoming connections and then proxy them to the correct container.

More complete PaaS solutions like Kubernetes and OpenShift have their own means of handling this (e.g. by running an internal haproxy container which does the same thing).

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.