skip to Main Content

I have a single static ip and want to know if it is possible to run several containers (lets say with ssh and apache) and let them be accessible from outside my local network by using my public ip. I tried it by using bind9 but dont think that works because i only have 1 ip address.

Some kind of router which connects based on a hostname or something for example?

I ended up using kubernetes with a clusterIP and nodePort service.

2

Answers


  1. The docker -p parameter can map multiple different SSH or Apache ports

    Login or Signup to reply.
  2. Yes, you can do this by having a reverse proxy like nginx in front of your containers.

    Nginx will then receive all the requests and route them to the correct container, based on the hostname.

    More info here: http://nginx.org/en/docs/http/server_names.html

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search