I made a Docker container of a website that’s difficult to deploy, and I can reliably deploy it on localhost on my personal machine. The container sets up an Apache server with all the files and config to run the website.
However, the story is different on my VPS running Ubuntu and Apache. I have two other websites running on the same VPS, each with different domains, and when I deploy the dockerized website I can’t access that site. I opened ports on UFW. The Docker container sets the site to run on port 8000, and I tried running a reverse proxy on just that site with Apache by defining a config pointing towards the internal Docker IP on port 8000, but no luck.
Now I’m thinking of running a reverse proxy, but I haven’t found any guides covering my situation: routing websites on both the host machine and through Docker. nginx-proxy looks to cover only Docker containers, and the Apache reverse proxy couldn’t access the Docker container.
What are my options here? I plan to dockerize everything eventually, but that will be sometime in the future and not right away.


First off, when you run a container without an outside IP set. Docker will bind that port, in your case 8000 to all ports. So hitting any of the domains on the vps on port 8000 should show your docker site.
Second, if your VPS is like my OVH VPS then it has only an internet IP. So any open ports are open to the internet at large.
If you want to host lots of sites on a single IP, then you will need a reverse proxy of some sort. I would recommend that your docker site is using 127.0.0.1:8000:8000 so that it’s only visible on the VPS. (If your ports are different then use what you and prefix 127.0.0.1)
I run similar to your setup, nextcloud is in a VM and lots of docker sites. What do you need to know?