Reputation: 8612
I have a web server container which will expose 80 port, and it will be deployed to 3 servers, the mapped port in host will change everytime, for example
host A: 10000 => 80
host A: 10001 => 80
host B: 10004 => 80
host B: 10008 => 80
host C: 10006 => 80
and also I have a proxy server in front of these 3 servers, I'm thinking to use haproxy or nginx, but how can I map dynamic ports in these 3 servers to fixed port in proxy server?
Upvotes: 1
Views: 2099
Reputation: 3195
You can do so when you run docker such as: "docker run -d -p 10000:80 host1", "docker run -d -p 10001:80 host2", "docker run -d -p 10004:80 host3" and so on or you might want to have a look at this script: https://github.com/lamuguo/wordpress-setup/blob/master/start_wordpress.sh
Upvotes: 0