I am very new to using docker. I have been used to using dedicated VM’s and hosting the applications within the servers OS.

When hosting multiple applications/services that require the same port, is it best practice to spin up a whole new docker server or how should I go about the conflicts?

Ie. Hosting multiple web applications that utilize 443.

Thank you!

  • @redcalcium
    link
    English
    9
    edit-2
    11 months ago

    You’ll need a load balancer/reverse proxy listening on ports 80 and 443. Then configure the load balancer to route traffics to the right containers. How to do that depends on the load balancer you use and the container platform you have. For example, Traefik works very well on docker compose platform because you can simply annotate your container to define the route. Another self-hosters favorite is Nginx Proxy Manager. If using kubernetes (e.g. via k3s), using Nginx Ingress is a good choice because the documentation is excellent and it’s easier to find help on the internet when you run into problems.

    • Nyknyak
      link
      fedilink
      211 months ago

      Came here to say the same. I just got done learning to do this with traefik and I’m very pleased with the docker-compose workflow