Docker Container


Docker is an open platform for distributed applications for developers and sysadmins. It can be used to quickly develop and deploy web applications.

You will need to first install Docker. Instructions can be found here:

Build and Run a Container

  1. docker-compose build
  2. docker-compose run --rm app /bin/bash -l -c "make everything"
  3. docker-compose up

By default you can connect to the site at http://localhost:9292

A useful starting place is http://localhost:9292/interactives.html

This container should automatically rebuild any changes you make to interactives.
It says it is reloading the browser after doing this, but that part is not working.
So you will need to reload the browser manually after making changes.

Opening an additional terminal

You can open a second terminal and run:

docker-compose exec app /bin/bash -l

This will allow you to run other commands.

Using a docker proxy

With a docker proxy you can avoid port conflicts with 9292, and the domain name of the site is friendlier. Once setup, you can access the site at: http://labinteractives.docker

To use this approach you need to:
- install and setup the proxy
- configure docker-compose to use a random port instead of 9292

The proxy we use is it has support for OS X, Linux, and Windows. At the link above you need to look at the section: Using Outside of Dinghy

docker-compose can be configured by copying the demo .env.sample to .env file at the top of the repository

Notes for running without docker-compose

To build and run a container:

  1. docker build -t lab-interactives-site .
  2. docker run --name interactives -p 9292:9292 -p 35729:35729 lab-interactives-site

Now you can connect to the server with http://localhost:9292

Notes For docker-machine/boot2docker

To connect to the LiveReload server, you’ll have to create an SSH tunnel after the container has started.

  1. Run docker-machine env default to get the machine’s IP address
  2. Run ssh -N -L 35729:localhost:35729 docker@<ip_addr_for_docker_machine> to start the ssh tunnel

If you don’t want to bother with SSH tunnels, you can use RemoteLiveReload instead. However, you’ll have to run the following command before building and starting the container.

sed -i "s/guard 'livereload'/guard 'livereload', host: '', port: '35729'/" Guardfile