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 running directly on the host without Docker. 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.

  • hendrik@palaver.p3x.de
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    2 days ago

    Yeah, You’ll have to do a lot more troubleshooting than this. Did Docker successfully bind to port 8000? Can you curl it from the VPS itself? Does the container and the things in it run properly? Are there any error messages in the logs?

    I’m not a Docker expert, but I’d start with the docker commands which show if a container is running and which ports it actually binds. Maybe a ss -at. then do a curl http://localhost:8000/ and see if it returns your webpage. If it doesn’t, you need to fix your webpage container first. Or see if you can come up with an easier method to deploy your website.

    A reverse proxy in any shape or form, will require your website to run, first.