$ docker build -t wires:latest .First, elect a directory that will hold all HTML sites. This will be mounted as /var/www/html into the container i.e. ./sites.
Second, elect a data directory which will be mounted as /opt/wireframes and hold the nginx configuration files for the sites.
Also, you must have a WIRES_DOMAIN which resolves to the Docker host i.e. wires.activelamp.com
We want to serve the v0.10 tag of git@github.com:client/project.git as http://project-v0-10.wires.activelamp.com:
-
Clone repo to a directory under the
./sitesdirectory.$ git clone git@github.com:client/project.git --branch v0.10 --depth=5 ./sites/c109ed
-
Register the sub-domain => directory mapping via the
add-sitecommand:$ docker run -e WIRES_DOMAIN=wires.activelamp.com \ -v ./wireframes:/opt/wireframes \ wires:latest \ add-site project-v0-10 c109edThis command will create the
nginxconfiguration files under./wireframes -
Start/restart service mounting our sites directory and the configuration directory:
$ docker run -e WIRES_DOMAIN=wires.activelamp.com \ -v ./wireframes:/opt/wireframes \ -v ./sites:/var/www/html \ -d wires:latest -
Register sub-domain to Route 53
To be implemented. Will use
awscli. -
Repeat Step 2 to add more sites. No need to restart service.
- Create a separate service to run on foreground so we can run it and have the freedom of reloading the
nginxconfigurations every time we calladd-site.