在docker中,有一种方法可以在同一个端口上运行多个容器,但使用不同的公共URL?让我们说,使用类似于: site的东西代替x.x:8090
就像这样:
docker run --name test1 -e VIRTUAL_HOST=site1.example.com -p 8090:80 -e AUTHOR="test1" -d -P dockersamples/static-site
docker run --name test2 -e VIRTUAL_HOST=site2.example.com -p 8090:80 -e AUTHOR="test2" -d -P dockersamples/static-site发布于 2018-03-18 12:53:02
您通常会使用像nginx这样的代理来完成这一任务,其中代理与其他容器在同一个网络上运行。然后,您可以使用Docker服务名称作为代理后端源。
https://stackoverflow.com/questions/49347124
复制相似问题