This project has two purposes:
- Prepare a docker image for CKAN, with all extensions and configurations needed to deploy the catalogue for the User Portal.
- Setup a development environment for testing, fixing and enhancing our customised CKAN and its extensions.
The CKAN images used are from the official CKAN ckan-docker repo.
The non-CKAN images are as follows:
- PostgreSQL: Official PostgreSQL image. Database files are stored in a named volume.
- Solr: CKAN's pre-configured Solr image. Index data is stored in a named volume.
- Redis: standard Redis image
- NGINX: latest stable nginx image that includes SSL and Non-SSL endpoints
- National Catalogue Mock: Python script to expose a synthetic RDF file, to test the Harvester.
CKAN and all the components are configured using environment variables that you can set in the .env
file.
- Install docker with support to docker compose v2.
- Ensure you have enough computer resources, if you are using
colima
:colima start --arch aarch64 --vm-type=vz --mount-type=virtiofs --vz-rosetta --cpu 4 --memory 10
- Ensure you have enough computer resources, if you are using
- Copy
.env.example
to.env
. - Ensure git submodules are pulled correctly after clone CKAN-DOCKER
git submodule update --init
Use this mode if you are making code changes to CKAN and either creating new extensions or making code changes to existing extensions. This mode also uses the .env
file for config options.
To develop local extensions use the docker-compose.yml
file with help from the scripts under bin
:
To build the images:
bin/compose build
To install extensions from the src
directory:
bin/install_src
To start the containers:
bin/compose up
bin/compose down -v
bin/compose logs -f
ckan -c ckan.ini search-index rebuild
The ckan instance runs on port defined in CKAN_PORT_HOST (5500). Access it at http://localhost:5500.
A sysadmin account is created by default with the following credentials (defined in .env):
CKAN_SYSADMIN_NAME=ckan_admin
CKAN_SYSADMIN_PASSWORD=test1234
The current agreement is:
- Fork all the branches from the extension's repo into GitHub GDI.
- Create and push a new branch following this standard:
user-portal-{original branch name/tag name}
Reminder, prefer always to use a release/tag branch, over main/master branches, to avoid not tested changes. - Add a git submodule:
git submodule add {git_ssh_url} src/ckanext-{extension}
. - Add branch reference into
.gitmodules
, if not added. - Configure the extension via environment variables or via a setup script. Setup scripts must be added into
ckan/docker-entrypoint.d/
. - Ensure the extension is working as expected.
- Update
ckan/Dockerfile
to install the new extension via pip.
All Docker Compose commands in this README will use the V2 version of Compose ie: docker compose
. The older version (V1)
used the docker-compose
command. Please see Docker Compose for
more information.
This work is licensed under multiple licenses. Here is a brief summary as of January 2024:
- All original source code is licensed under AGPL-3.0-only, copyright (c) 2006-2024 Open Knowledge Foundation and contributors.
- All documentation is licensed under CC-BY-4.0.
- github actions workflows are licensed under Apache-2.0.
- For more accurate information, check the individual files.