I currently have a number of small VMs running docker containers. The VMs are small because there are so many of them and as a result frequently lock up, usually when calling the S3 command line tool, but today when trying to use wget to download a DEB file.
The reason I do it this way is that docker seemed like a good idea at the time, and each mini service has a different hostname but I want to use the standard ports (80/443) so users don't have to remember custom URLs, only the hostname.
I am fed up with all the problems of these virtual machines. I would like to move to a single powerful server running a number of docker containers. However as each container is using port 80 and port 443, there will be a port clash.
I would prefer not to use redirects such that https://ldap.intranet.local gets redirected to https://ldap.intranet.local:3000 as that will modify the URL the user sees in the browser, and I would prefer this to be 100% transparent.
My current solution, and I am open to others, is to use the Apache's capability to recognise requests by hostname to forward requests to a different port.
I.e. if a request comes in to https://ldap.intranet.local, Apache will forward it to https://127.0.0.1:3000, and the LDAP docker container will be run such that external port 3000 maps to internal port 443. The web server inside the docker container will then pick it up and process it.
Similarly when a request comes in to https://jenkins.intranet.local, Apache will forward it to https://127.0.0.1:4000, and the Jenkins docker container will be run such that external port 4000 maps to internal port 443. The web server inside the docker container will then pick it up and process it.
And so on and so forth.
Is this possible? If so how do I configure Apache to do it? If not how else can I solve my problem?
Many thanks in advance for your help.