Assigning vhosts to Docker ports

前端 未结 3 1529
面向向阳花
面向向阳花 2020-11-30 16:27

I have a wildcard DNS set up so that all web requests to a custom domain (*.foo) map to the IP address of the Docker host. If I have multiple containers running Apache (or

3条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-30 17:06

    With docker, you want the internal ips to remain normal (e.g. 80) and figure out how to wire up the random ports.

    One way to handle them, is with a reverse proxy like hipache. Point your dns at it, and then you can reconfigure the proxy as your containers come up and down. Take a look at http://txt.fliglio.com/2013/09/protyping-web-stuff-with-docker/ to see how this could work.

    If you're looking for something more robust, you may want to take a look at "service discovery." (a look at service discovery with docker: http://txt.fliglio.com/2013/12/service-discovery-with-docker-docker-links-and-beyond/)

提交回复
热议问题