I use a single hostname for all my web-services on the Docker image. Lets say, “sandbox”. Currently whenever I run the container I pass
-h sandbox to
docker run and then edit
/etc/hosts on host with
sandbox mapped to the container IP. Web-service on the container are routed through
nginx so only port 80 is exposed to the host.
I am guessing there is a better (not manual) way to achieve this. Any suggestions would be great.