Technically i shouldn't be asking this question as i was already able to successfully accomplish it, however i did not record any of my notes/findings on it and i was forced to delete the centos VM it was on as it would not boot properly. So now its FUBAR and need to remember what i did.
The challange for me was to have 3 different docker containers. A npm repo container, a bower container (Link in comment 1), and controlled by a nginx container. The npm repo and the bower had to be able to access the same IP address but down different ports and be accessed via special names like bower.swig.swag. or npm.swig.swag. The port handling would have been taken care of by the nginx container and would in turn have any containers desiring to be accessed at the IP address to attach the
--env flag of
VIRTUAL_HOST= (As stated from the docker info on the nginx link).
So the IP that was desired for the npm containers and bower containers was 10.1.10.1 down ports 8080:8080 and 5678:5678 respectively. I think the DNS server was 10.1.10.30 or it was based on the localhost, however i cant really be sure at the moment as almost all IP's i try to provide, excluding the localhost 127.0.0.1 and 10.0.2.15 do not work with relationship to the
docker run -p flag (i have no idea why this happened. One minute, any ip i provide to docker works and after deleting it, it does not. I got a link to the error here in comment 2. Stupid link rule.) Nginx was targeted to the local host if im remembering this correctly. Down port 80:80.
I cant remember the exact flags i used, but here are some of the possible flags i needed to run with docker. They were a mix of
docker run -p, --dns=, --env=VIRTUAL_HOST=, -h, --expose
When we specified the virtual host for the container, we also had to modify something in the vim/vi file of
/etc/hosts but i cant remember how i am supposed to add it. In the end, someone should be able to take the specified virtual host name, go into a browsers http bar and type,
http://virtualhostname and be granted access to the website. Thats how i knew it was working. Think anybody can get me back on track? (Will be posting this to stack overflow as well. I cant really balance between which site to use so i might as well.)