Add Dockerfile for building a CKAN 2.2 image

This commit adds a Dockerfile and support files (including nginx and
runit configuration) for a binary CKAN 2.2 docker image.

Specifically, this allows you to build a docker image including CKAN
2.2, running behind nginx and gunicorn, by running

    docker build .

For example, to build an image called ckan/ckan tagged at version 2.2,
you might run

    docker build -t ckan/ckan:2.2 .

The resulting image contains only CKAN, with a nearly vanilla
configuration. In order to use it, you must do one of two things. You
can either use the vanilla configuration as-is, and this requires that
you specify the location of a Postgres database and a Solr core on
startup:

    docker run -i -t -p 80:80 \
      -e DATABASE_URL=postgres://user:pass@hostname/db \
      -e SOLR_URL=http://hostname:8983/solr/ckan_default \
      ckan/ckan:2.2

This will run CKAN, connect to the database, and initialise it if need
be. Configuring Solr will have to be done separately.

Alternatively, you can use this image as a base for extension. If a
configuration file is injected to /etc/ckan/default.ini, the image will
use that and ignore the DATABASE_URL and SOLR_URL environment variables.

Lastly, by default the CKAN file store is at /var/lib/ckan, and you may
well wish to mount this data volume outside the running container:

    docker run ... -v /mnt/storage:/var/lib/ckan ...
Add postfix to docker image and allow configuration

This ensures that we can configure error emails from the CKAN instance
inside the container.

An optional environment variable, ERROR_EMAIL, can be set for the
container. If set, it will configure CKAN to send error emails to
$ERROR_EMAIL. If unset, no emails will be sent.
Switch to mod_wsgi in preference to gunicorn

As discussed previously, we're going to change one thing at a time so
this sticks to the default installation instructions and uses mod_wsgi
to run CKAN rather than gunicorn.

Also revert paths to the defaults (/etc/ckan/default,
/usr/lib/ckan/default, etc.)
Add a Dockerfile for a simple CKAN Solr container

This adds a Dockerfile which can build a simple container running Solr
4.8.1 with a "ckan" core which uses the schema from the ckan/config/solr
directory.
Add documentation on installing with Docker

Adds a page to the installation documentation explaining how to use and
customise the Docker image. Note that not all of the commands listed
here will work until we merge the Dockerfile and configure the building
of the image on the Docker Hub.
Update instructions to use containerised Solr/Pg by default

Getting CKAN to talk to Postgres and Solr on the Docker host is
perfectly possible, but explaining how to set up appropriate routes in
iptables is outside the scope of the CKAN installation docs.

This commit updates the CKAN run script to support connection to Pg and
Solr through Docker links, and updates the documentation accordingly.
docker: Initialise postfix correctly

Postfix initialisation is a bit more complicated than the service file assumed
and doesn't actually work due to pieces missing from the chroot. Delegate to
the sysv init script and tail the log to keep the process running.

This is potentially a problem if postfix crashes and doesn't come back, but I
reckon finding a crashing bug in postfix is a few orders of magnitude less
likely than finding a similar bug in CKAN.
docker: Explicitly set nginx types_hash_bucket_size

As discovered by the inimitable bug-hunter @nigelbabu, on the version of
Nginx in the image, the value of types_hash_bucket_size is set at
runtime to the processor cache line size.

This means that on hardware with small cache lines (16 bytes) the image
can fail to start with:

    nginx: [emerg] could not build the types_hash, you should increase
    either types_hash_max_size: 1024 or types_hash_bucket_size: 32

This commit sets types_hash_bucket_size and types_hash_max_size to the
values used by latest Nginx (1.7.2 at the time of writing).
docs: Add note about requirement of Docker>=1.0

The built images don't appear to work with Docker<0.10.0, in particular
not with the version of Docker that currently ships as "docker.io" in
the Ubuntu 14.04 repositories.

The install instructions do link directly to the official install docs
for Docker, which don't recommend the distro packages, but we make this
explicit now in a callout at the top of the page.
docs: Explicitly note omission of DataStore/DataPusher

Support for these parts of CKAN will come in a future PR.
Merge pull request #1755 from nickstenning/docker

[#1766] Dockerfile for CKAN