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?
CodePudding user response:
The docker -p
parameter can map multiple different SSH or Apache ports
CodePudding user response:
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