okfn / docker-ckan

Docker images and Docker Compose setup for CKAN [Not Maintained]
GNU Affero General Public License v3.0
81 stars 91 forks source link

Support custom setup scripts in the base images #10

Closed amercader closed 6 years ago

amercader commented 6 years ago

A really common scenario when building custom images for your project is that you'll need to initialize things in the database for an extension, or basically perform a task that needs to be done at run time, not build time.

Right now if you needed to this you would need to override the entry script in CMD to use a custom one in the ckan image. This means a lot of duplication, as you need to basically copy start_ckan.sh and start_ckan_development.sh to add a call to your custom script (eg prerun_validation.py to initialize some extension tables in the database). A better approach would be to support custom scripts in an entrypoint folder, similarly to what the postgres image offers (see How to extend this image). We could execute any *.sh or *.py file present in the folder, sorted by name like the Postgres image does.