Hi all,
I’m quite new to Docker but am also looking after a live system with multiple Docker containers that was created by my predecessor who also left his job without leaving any documentation behind. I’m now supposed to look after the system, despite having to “learn as I go”. So my setup is complex (for me) but my question will be a bit elementary – apologies in advance!
On an Ubuntu 20.04 system, we are running Docker v19.03.11 . There are numerous (almost 20) Docker containers running, none of which I wrote but I have to maintain… They all communicate with each other – I guess as a “swarm”? One of these containers run nginx, which forwards requests to the other containers.
Now, I would like to add a new web server, but running on the host machine. So, I would like the nginx to be able to forward to both the other existing Docker containers and Apache2 running on the host machine. Is this possible?
For just the latter, various Google searches have said that I should use --network="host"
. For the former, well, it’s already working. But I haven’t found any information yet whether both simultaneously is possible. Since it’s a live system with 20 containers that I’m gradually learning about, I thought I’d ask before I get to the point where things get broken. (Of course, at some point, I will need to figure out how those 20 containers work…but I can figure that out later since setting up Apache2 on the host is (currently) a higher priority.)
The Apache2-based system cannot (as far as I can tell) become a Docker container. I can’t make it into a docker-compose.yml
file since there is some GUI-based interaction that’s required by the user in order to set it up.
Anyway, is the network configuration that I mentioned above possible? Could I set it up so that nginx in a Docker container forward abc and def to other Docker containers, but ghi goes to the host machine on Apache running on some other port like port 1234? (Since port 80 traffic will go from the host to the nginx Docker container.)
(Perhaps if I could start from the beginning and redo it all, nginx should run on the host and ghi gets sent to localhost, and abc and def gets forwarded to docker containers. But I worry doing so will break things.)
Any help would be appreciated!
Thank you!
Ray