SSH is supported using an insecure key which is enabled by default for development purposes. You should disable it in production use for obvious reasons.
The data container is optional but recommended. It exposes two volumes to store the Postgres data `($PGDATA)`& CKAN FileStore. This means you can recreate / app containers without loosing your data.
The container is cross version compatible. You need mount the appropriate `schema.xml` as a volume, or build a child image, which will copy the `schema.xml` next to your Dockerfile.
Read the [ckanext-spatial documentation](http://docs.ckan.org/projects/ckanext-spatial/en) to add the required fields to your Solr schema if you use ckanext-spatial
The Docker socket needs to be mounted as a volume to control Docker on the host. A source folder must be mounted to access the fig definition
see docker/Fig/Readme to find out how to use
#### Vagrantfile
Defines VMs provided by Docker, a Virtual Box docker-host is used if the host can't run Docker containers natively. This is an alternative to Boot2Docker.
#### fig.yml
Defines the set of services required to run CKAN. Read the [fig.yml reference](http://www.fig.sh/yml.html) to understand and edit.
_In the fig container fig won't work with relative path, because the mount namespace is different, you need to change the relative path to absolute path_
for example, change the `./`:
volumes:
- ./_src:/usr/lib/ckan/default/src
to an absolute path to you ckan-docker directory: `/Users/username/git/ckan/ckan-docker/`
### Using paster serve instead of apache for development
CKAN container starts Apache2 by default and the `ckan.site_url` port is set to `8080` in `50_configure`.
You can override that permanently in the `custom_options.ini`, or manually in the container, for instance if you want to use paster in a development context.
Example (`paster serve --reload` in debug mode):
docker exec -it src_ckan_1 /bin/bash
supervisorctl stop apache2
sed -i -r 's/debug = false/debug = true/' $CKAN_CONFIG/$CONFIG_FILE
sed -i -r 's/ckan.localdomain:8080/ckan.localdomain:5000/' $CKAN_CONFIG/$CONFIG_FILE
Front end development is also possible (see [Frontend development guidelines](http://docs.ckan.org/en/latest/contributing/frontend/))
Install frontend dependencies:
docker exec -it src_ckan_1 /bin/bash
apt-get update
apt-get install -y nodejs npm
ln -s /usr/bin/nodejs /usr/bin/node
source $CKAN_HOME/bin/activate
cd $CKAN_HOME/
npm install nodewatch less@1.3.3
Both examples show that development dependencies should only be installed in the containers when required. Since they are not part of the `Dockerfile` they do not persist and only serve the purpose of development. When they are no longuer needed the container can be rebuilt allowing to test the application in a production-like state.