{"id":13856856,"url":"https://github.com/okfn/docker-ckan","last_synced_at":"2026-01-23T00:25:15.323Z","repository":{"id":41086383,"uuid":"117965236","full_name":"okfn/docker-ckan","owner":"okfn","description":"Docker images and Docker Compose setup for CKAN [Not Maintained]","archived":false,"fork":false,"pushed_at":"2023-11-22T14:37:29.000Z","size":219,"stargazers_count":81,"open_issues_count":31,"forks_count":88,"subscribers_count":18,"default_branch":"master","last_synced_at":"2024-08-06T03:02:25.625Z","etag":null,"topics":["ckan","docker","docker-compose"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/okfn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-18T10:02:21.000Z","updated_at":"2024-06-04T17:31:50.000Z","dependencies_parsed_at":"2023-02-16T07:30:47.333Z","dependency_job_id":null,"html_url":"https://github.com/okfn/docker-ckan","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okfn%2Fdocker-ckan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okfn%2Fdocker-ckan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okfn%2Fdocker-ckan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okfn%2Fdocker-ckan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/okfn","download_url":"https://codeload.github.com/okfn/docker-ckan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225912332,"owners_count":17544149,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ckan","docker","docker-compose"],"created_at":"2024-08-05T03:01:16.180Z","updated_at":"2026-01-23T00:25:15.292Z","avatar_url":"https://github.com/okfn.png","language":"Shell","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Docker Compose setup for CKAN [Not Maintained]\n\n| ⚠️ Not maintained :warning: |\n| --- | \n| These images are deprecated and are no longer maintained. Please use the official CKAN Docker images instead: |\n| https://github.com/ckan/ckan-docker|\n| For more information see: https://github.com/okfn/docker-ckan/issues/129 |\n\n\n\n* [Overview](#overview)\n* [Quick start](#quick-start)\n* [Development mode](#development-mode)\n   * [Create an extension](#create-an-extension)\n   * [Running the debugger (pdb / ipdb)](#running-the-debugger-pdb--ipdb)\n* [CKAN images](#ckan-images)\n   * [Extending the base images](#extending-the-base-images)\n   * [Applying patches](#applying-patches)\n* [Known Issues](#known-issues)\n* [License](#license)\n\n\n## Overview\n\nThis is a set of Docker images and configuration files to run a CKAN site.\n\n| CKAN version | Docker tag production | Docker tag development | Notes |\n| --- | --- | --- | --- |\n| 2.8    | `openknowledge/ckan-base:2.8`,  `openknowledge/ckan-base:2.8.12`   | `openknowledge/ckan-dev:2.8`,  `openknowledge/ckan-dev:2.8.12` | |\n| 2.9    | `openknowledge/ckan-base:2.9`, `openknowledge/ckan-base:2.9.9`    | `openknowledge/ckan-dev:2.9`, `openknowledge/ckan-dev:2.9.9`  | If you need Python 2 images use the `2.9-py2` tags (not recommended) |\n| 2.10b    | `openknowledge/ckan-base:2.10`, `openknowledge/ckan-base:2.10.1`    | `openknowledge/ckan-dev:2.10`, `openknowledge/ckan-dev:2.10.1`  |CKAN 2.10 is currently in beta |\n| master | `openknowledge/ckan-base:master` | `openknowledge/ckan-dev:master` | The `master` images are updated daily so they might be slightly out of date |\n\n\nIt includes the following images, all based on [Alpine Linux](https://alpinelinux.org/):\n\n* CKAN: modified from keitaro/ckan (see [CKAN Images](#ckan-images)) for more details). File uploads are stored in a named volume.\n* DataPusher: modified from keitaro/datapusher\n* PostgreSQL: Official PostgreSQL image. Database files are stored in a named volume.\n* Solr: CKAN's [pre-configured Solr image](https://github.com/ckan/ckan-solr). Index data is stored in a named volume.\n* Redis: standard Redis image\n\nThe site is configured via env vars (the base CKAN image loads [ckanext-envvars](https://github.com/okfn/ckanext-envvars)), that you can set in the `.env` file.\n\n## Quick start\n\nCopy the included `.env.example` and rename it to `.env` to modify it depending on your own needs.\n\nUsing the default values on the `.env.example` file will get you a working CKAN instance. There is a sysadmin user created by default with the values defined in `CKAN_SYSADMIN_NAME` and `CKAN_SYSADMIN_PASSWORD`(`ckan_admin` and `test1234` by default). I shouldn't be telling you this but obviously don't run any public CKAN instance with the default settings. Make sure to set up proper passwords and secret keys in your `.env` file.\n\nTo build the images:\n\n\tdocker-compose build\n\nTo start the containers:\n\n\tdocker-compose up\n\n## Development mode\n\nTo develop local extensions use the `docker-compose.dev.yml` file:\n\nTo build the images:\n\n\tdocker-compose -f docker-compose.dev.yml build\n\nTo start the containers:\n\n\tdocker-compose -f docker-compose.dev.yml up\n\nSee [CKAN Images](#ckan-images) for more details of what happens when using development mode.\n\n\n### Create an extension\n\nYou can use the paster template in much the same way as a source install, only executing the command inside the CKAN container and setting the mounted `src/` folder as output:\n\n    docker-compose -f docker-compose.dev.yml exec ckan-dev /bin/bash -c \"paster --plugin=ckan create -t ckanext ckanext-myext -o /srv/app/src_extensions\"\n\nFrom CKAN 2.9 onwards, the `paster` command used for common CKAN administration tasks has been replaced with the `ckan` command. You can create an extension as the previous version by executing the command inside the CKAN container and setting the mounted `src/` folder as output:\n\n    docker-compose -f docker-compose.dev.yml exec ckan-dev /bin/bash -c \"ckan generate extension --output-dir /srv/app/src_extensions\"\n\nThe new extension will be created in the `src/` folder. You might need to change the owner of its folder to have the appropiate permissions.\n\n\n### Running the debugger (pdb / ipdb)\n\nTo run a container and be able to add a breakpoint with `pdb` or `ipdb`, run the `ckan-dev` container with the `--service-ports` option:\n\n    docker-compose -f docker-compose.dev.yml run --service-ports ckan-dev\n\nThis will start a new container, displaying the standard output in your terminal. If you add a breakpoint in a source file in the `src` folder (`import pdb; pdb.set_trace()`) you will be able to inspect it in this terminal next time the code is executed.\n\n\n## CKAN images\n\n```\n    +-------------------------+                +----------+\n    |                         |                |          |\n    | openknowledge/ckan-base +----------------\u003e   ckan   | (production)\n    |                         |                |          |\n    +-----------+-------------+                +----------+\n                |\n                |\n    +-----------v------------+                 +----------+\n    |                        |                 |          |\n    | openknowledge/ckan-dev +-----------------\u003e   ckan   | (development)\n    |                        |                 |          |\n    +------------------------+                 +----------+\n\n\n```\n\nThe Docker images used to build your CKAN project are located in the `ckan/` folder. There are two Docker files:\n\n* `Dockerfile`: this is based on `openknowledge/ckan-base` (with the `Dockerfile` on the `/ckan-base/\u003cversion\u003e` folder), an image with CKAN with all its dependencies, properly configured and running on [uWSGI](https://uwsgi-docs.readthedocs.io/en/latest/) (production setup)\n* `Dockerfile.dev`: this is based on `openknowledge/ckan-dev` (with the `Dockerfile` on the `/ckan-dev/\u003cversion\u003e` folder), wich extends `openknowledge/ckan-base` to include:\n\n  * Any extension cloned on the `src` folder will be installed in the CKAN container when booting up Docker Compose (`docker-compose up`). This includes installing any requirements listed in a `requirements.txt` (or `pip-requirements.txt`) file and running `python setup.py develop`.\n  * The CKAN image used will development requirements needed to run the tests .\n  * CKAN will be started running on the paster development server, with the `--reload` option to watch changes in the extension files.\n  * Make sure to add the local plugins to the `CKAN__PLUGINS` env var in the `.env` file.\n\nFrom these two base images you can build your own customized image tailored to your project, installing any extensions and extra requirements needed.\n\n### Extending the base images\n\nTo perform extra initialization steps you can add scripts to your custom images and copy them to the `/docker-entrypoint.d` folder (The folder should be created for you when you build the image). Any `*.sh` and `*.py` file in that folder will be executed just after the main initialization script ([`prerun.py`](https://github.com/okfn/docker-ckan/blob/master/ckan-base/setup/prerun.py)) is executed and just before the web server and supervisor processes are started.\n\nFor instance, consider the following custom image:\n\n```\nckan\n├── docker-entrypoint.d\n│   └── setup_validation.sh\n├── Dockerfile\n└── Dockerfile.dev\n\n```\n\nWe want to install an extension like [ckanext-validation](https://github.com/frictionlessdata/ckanext-validation) that needs to create database tables on startup time. We create a `setup_validation.sh` script in a `docker-entrypoint.d` folder with the necessary commands:\n\n```bash\n#!/bin/bash\n\n# Create DB tables if not there\npaster --plugin=ckanext-validation validation init-db -c $CKAN_INI\n```\n\nAnd then in our `Dockerfile` we install the extension and copy the initialization scripts:\n\n```Dockerfile\nFROM openknowledge/ckan-dev:2.9\n\nRUN pip install -e git+https://github.com/frictionlessdata/ckanext-validation.git#egg=ckanext-validation \u0026\u0026 \\\n    pip install -r https://raw.githubusercontent.com/frictionlessdata/ckanext-validation/master/requirements.txt\n\nCOPY docker-entrypoint.d/* /docker-entrypoint.d/\n```\n\n### Applying patches\n\nWhen building your project specific CKAN images (the ones defined in the `ckan/` folder), you can apply patches \nto CKAN core or any of the built extensions. To do so create a folder inside `ckan/patches` with the name of the\npackage to patch (ie `ckan` or `ckanext-??`). Inside you can place patch files that will be applied when building\nthe images. The patches will be applied in alphabetical order, so you can prefix them sequentially if necessary.\n\nFor instance, check the following example image folder:\n\n```\nckan\n├── patches\n│   ├── ckan\n│   │   ├── 01_datasets_per_page.patch\n│   │   ├── 02_groups_per_page.patch\n│   │   ├── 03_or_filters.patch\n│   └── ckanext-harvest\n│       └── 01_resubmit_objects.patch\n├── Dockerfile\n└── Dockerfile.dev\n\n```\n\n\n## Known Issues\n\n* Running the tests: Running the tests for CKAN or an extension inside the container will delete your current database. We need to patch CKAN core in our image to work around that.\n\n\n# License\n\nThis material is open and licensed under the GNU Affero General Public License (AGPL) v3.0 whose full text may be found at:\n\nhttp://www.fsf.org/licensing/licenses/agpl-3.0.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fokfn%2Fdocker-ckan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fokfn%2Fdocker-ckan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fokfn%2Fdocker-ckan/lists"}