A few days ago I submitted a pull request to share my work on Docker for CKAN with the rest of the community.
But itβs a little too big π β¦ 37 files changed with 1,266 additions and 115 deletions.
So weβve decided to move the Docker, Fig & Vagrant stuff out of the main CKAN repo, which makes a lot of sense.
In the meantime Iβve officially become a member of the CKAN organisation on Github which is pretty cool!
Extracting the Docker stuff out got me thinking a lot, and I re-factored even more stuff.
Iβve come up with a radically different tree structure:
βββ Dockerfile # CKAN Dockerfile
βββ LICENCE
βββ README.md
βββ Vagrantfile # CKAN Vagrantfile
βββ _etc # config files copied to /etc
βΒ Β βββ README.md
βΒ Β βββ apache2
βΒ Β βΒ Β βββ apache.conf
βΒ Β βΒ Β βββ apache.wsgi
βΒ Β βββ ckan
βΒ Β βΒ Β βββ custom_options.ini
βΒ Β βββ cron.d
βΒ Β βΒ Β βββ ckan
βΒ Β βββ my_init.d
βΒ Β βΒ Β βββ 55_configure
βΒ Β βββ nginx
βΒ Β βΒ Β βββ nginx.conf
βΒ Β βββ postfix
βΒ Β βΒ Β βββ main.cf
βΒ Β βββ supervisor
βΒ Β βββ conf.d
βββ _service-provider # any service provider used in the portal
βΒ Β βββ README.md
βΒ Β βββ datapusher
βββ _solr # any custom schema
βΒ Β βββ README.md
βΒ Β βββ schema.xml
βββ _src # CKAN & extensions source code
βΒ Β βββ README.md
βΒ Β βββ ckan
βΒ Β βββ ckanext-...
βββ docker # Dockerfiles & supporting files
βΒ Β βββ ckan
βΒ Β βΒ Β βββ my_init.d
βΒ Β βΒ Β βββ pip_install_req.sh
βΒ Β βΒ Β βββ svc
βΒ Β βββ fig
βΒ Β βΒ Β βββ Dockerfile
βΒ Β βΒ Β βββ README.md
βΒ Β βββ insecure_key
βΒ Β βββ nginx
βΒ Β βΒ Β βββ Dockerfile
βΒ Β βΒ Β βββ cmd.sh
βΒ Β βββ postgres
βΒ Β βΒ Β βββ Dockerfile
βΒ Β βΒ Β βββ svc
βΒ Β βββ solr
βΒ Β βββ Dockerfile
βΒ Β βββ svc
βββ fig.yml
βββ vagrant # Vagrant Docker host (used in OS X & Windows)
βββ docker-host
βββ Vagrantfile
The point of this structure if that it should be easy to manage your entire project. This should be able to wrap everything you need in there, and package it.
Iβve also consolidated the various Dockerfiles I wrote for CKAN (default, custom & dev) into one π
- all processes are managed by supervisor, which makes it easier to shut-down Apache in a development context, and use paster instead.
- Nginx now gone from the CKAN Dockerfile, and this service is now handled by another container as it should
- The requirement of being able to make live edits on the code for development is covered by mounting a volume as source directory, which overrides the data that was initially copied in the container. Pip requirements remain and I just have to re-install the packages automatically as part of the init process.
- Iβve added a lot of
ONBUILD
triggers that allow building children images for dev & prod, which covers what I was initially doing with my custom Dockerfile. -Iβve also extracted the datapusher from the CKAN config, into a separate container.
And there is moreβ¦
Check this out on CKAN Github repo
Cheers,
ClΓ©ment
Recent Comments