I have a host that is a web server. I have several Linux containers in this host, and Apache is installed in each of them. The server runs in each container and can be accessed via localhost. Each container has port 80 to 80 ** forwarded so I should get in from the outside by specifying the host address and port number but I have a connection with only one of them. In addition, I’d like to get to individual servers not by specifying the port number next to the host address, but as follows:
docker_hostname.host_address
Uhm, have you ever thought about introducing a reverse proxy as an entrypoint into your container networks? Then forward traffic to the backend container depending on the subdomain or context path. You will additionaly need dns records that provide the lookup for your subdomains.
Now that makes me curious. Can you elaborate on how this reverse proxy image allows to access a service using docker_hostname.host_address from a host with your solution? How should the host know when docker_hostname.host_address is used as domain in a URL that the docker host should be used, without name resolution in place (by dns or hosts file)?