From 6ad77ec1c8402f02ffafaed5843e4d5c5027cfc6 Mon Sep 17 00:00:00 2001 From: Xavier Frankline Date: Thu, 29 May 2025 13:17:43 +0300 Subject: [PATCH 1/3] Upgrade to ckan 2.10.8 Update Makefile --- Dockerfile | 3 +- Makefile | 43 ++++++++++--------- .../docker-entrypoint.d/openafrica_ckan.sh | 1 + docker-compose.yml | 10 ++--- 4 files changed, 28 insertions(+), 29 deletions(-) diff --git a/Dockerfile b/Dockerfile index ce5d7b8..4ccf60a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,4 @@ -# FROM ckan/ckan-base:2.10.4 -FROM ckan/ckan-base:2.10.7-py3.10 +FROM ckan/ckan-base:2.10.8-py3.10 # Install any extensions needed by your CKAN instance # - Make sure to add the plugins to CKAN__PLUGINS in the .env file # - Also make sure all provide all extra configuration options, either by: diff --git a/Makefile b/Makefile index 87ca0fd..9e55bb3 100644 --- a/Makefile +++ b/Makefile @@ -1,46 +1,49 @@ +include $(PWD)/.env + build: - docker-compose build + docker compose build + +up: + docker compose up build-web: - docker-compose build web + docker compose build web web: - docker-compose up web -bash: - docker-compose exec web bash + docker compose up web - -paster: - docker-compose exec web paster --plugin=ckan +bash: + docker compose exec web bash db-init: - docker-compose exec web paster --plugin=ckan db init + docker compose exec web ckan -c ckan.ini db init + db-upgrade: - docker-compose exec web paster --plugin=ckan db upgrade + docker compose exec web ckan -c ckan.ini db upgrade + rebuild-index: - docker-compose exec web paster --plugin=ckan search-index rebuild -r -issues-init: - docker-compose exec web paster --plugin=ckanext-issues issues init_db + docker compose exec web ckan -c ckan.ini search-index rebuild +issues-init: + docker compose exec web ckan -c ckan.ini issues init_db ckan: - docker build --no-cache --build-arg CKAN_VERSION=2.9.0 -t codeforafrica/ckan:latest -t codeforafrica/ckan:2.9.0 contrib/ckan + docker buildx build --platform linux/amd64 --no-cache --build-arg CKAN_VERSION=$(CKAN_VERSION) -t codeforafrica/ckan:latest -t codeforafrica/ckan:$(CKAN_VERSION) -f Dockerfile . ckan-publish: docker push codeforafrica/ckan:latest - docker push codeforafrica/ckan:2.9.0 + docker push codeforafrica/ckan:$(CKAN_VERSION) solr: - docker build --no-cache --build-arg CKAN_VERSION=2.9.0 -t codeforafrica/ckan-solr:latest -t codeforafrica/ckan-solr:2.9.0 contrib/solr + docker buildx build --platform linux/amd64 --no-cache --build-arg CKAN_VERSION=$(CKAN_VERSION) -t codeforafrica/ckan-solr:latest -t codeforafrica/ckan-solr:$(SOLR_IMAGE_VERSION) contrib/solr solr-publish: docker push codeforafrica/ckan-solr:latest - docker push codeforafrica/ckan-solr:2.8.11 - + docker push codeforafrica/ckan-solr:$(SOLR_IMAGE_VERSION) datapusher: - docker build -t codeforafrica/ckan-datapusher:latest -t codeforafrica/ckan-datapusher:0.0.15 contrib/ckan-datapusher + docker buildx build --platform linux/amd64 -t codeforafrica/ckan-datapusher:latest -t codeforafrica/ckan-datapusher:$(DATAPUSHER_VERSION) contrib/ckan-datapusher datapusher-publish: docker push codeforafrica/ckan-datapusher:latest - docker push codeforafrica/ckan-datapusher:0.0.15 + docker push codeforafrica/ckan-datapusher:$(DATAPUSHER_VERSION) diff --git a/contrib/ckan/docker-entrypoint.d/openafrica_ckan.sh b/contrib/ckan/docker-entrypoint.d/openafrica_ckan.sh index 9b823d3..430182c 100644 --- a/contrib/ckan/docker-entrypoint.d/openafrica_ckan.sh +++ b/contrib/ckan/docker-entrypoint.d/openafrica_ckan.sh @@ -15,6 +15,7 @@ fi #Auth settings ckan config-tool ${CKAN_INI} -s app:main -e ckan.auth.create_user_via_web=true ckan config-tool ${CKAN_INI} -s app:main -e ckan.auth.public_user_details=true +ckan config-tool ${CKAN_INI} -s app:main -e ckan.auth.create_default_api_keys=true #Auth settings, limit actions to sysadmin users ckan config-tool ${CKAN_INI} -s app:main -e ckan.auth.user_create_organizations=false diff --git a/docker-compose.yml b/docker-compose.yml index 4b417e5..3d244f6 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,27 +24,23 @@ services: test: ["CMD", "pg_isready", "-U", "${POSTGRES_USER}", "-d", "${POSTGRES_DB}"] web: container_name: web - build: - context: . - dockerfile: Dockerfile + image: codeforafrica/ckan:${CKAN_VERSION} depends_on: - solr - redis ports: - "5050:5000" - volumes: - - ./contrib/ckan/ckan.ini:/srv/app/ckan.ini env_file: - .env datapusher: container_name: datapusher - image: ckan/ckan-base-datapusher:0.0.20 + image: ckan/ckan-base-datapusher:${DATAPUSHER_VERSION} ports: - "8800:8800" solr: - image: ckan/ckan-solr:2.10-solr8 + image: ckan/ckan-solr:${SOLR_IMAGE_VERSION} ports: - "8983:8983" volumes: From 2c6cb026b59f44d85fa7b612fe3844718968285f Mon Sep 17 00:00:00 2001 From: Xavier Frankline Odhiambo <49587182+thepsalmist@users.noreply.github.com> Date: Thu, 29 May 2025 16:46:27 +0300 Subject: [PATCH 2/3] Update Makefile Co-authored-by: Clemence Kyara --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9e55bb3..9c56b70 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ issues-init: docker compose exec web ckan -c ckan.ini issues init_db ckan: - docker buildx build --platform linux/amd64 --no-cache --build-arg CKAN_VERSION=$(CKAN_VERSION) -t codeforafrica/ckan:latest -t codeforafrica/ckan:$(CKAN_VERSION) -f Dockerfile . + docker buildx build --platform linux/amd64 --no-cache --build-arg CKAN_VERSION=$(CKAN_VERSION) --tag codeforafrica/ckan:latest --tag codeforafrica/ckan:$(CKAN_VERSION) . ckan-publish: docker push codeforafrica/ckan:latest From 75473f8d9675e4c303915e4fe7abc77f68102b52 Mon Sep 17 00:00:00 2001 From: Xavier Frankline Date: Thu, 29 May 2025 17:04:13 +0300 Subject: [PATCH 3/3] Update Makefile --- .env.tmpl | 12 ++++++++++++ Makefile | 6 +++--- docker-compose.yml | 7 +++++-- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.env.tmpl b/.env.tmpl index 166f58f..51a0b6e 100755 --- a/.env.tmpl +++ b/.env.tmpl @@ -43,3 +43,15 @@ CKAN_RECAPTCHA_PRIVATE_KEY="" # request timeout in X seconds CKAN_REQUESTS_TIMEOUT=30 CKAN_RESOURCE_PROXY_TIMEOUT=30 + +# Solr +CKAN_SOLR_VERSION=2.10-solr9 +CKAN_SOLR_URL=http://solr:8983/solr/ckan +TEST_CKAN_SOLR_URL=http://solr:8983/solr/ckan + +# Datapusher +DATAPUSHER_VERSION=0.0.21 +CKAN_DATAPUSHER_URL=http://datapusher:8800 +CKAN__DATAPUSHER__CALLBACK_URL_BASE=http://ckan:5000 +DATAPUSHER_REWRITE_RESOURCES=True +DATAPUSHER_REWRITE_URL=http://ckan:5000 diff --git a/Makefile b/Makefile index 9c56b70..1b8223f 100644 --- a/Makefile +++ b/Makefile @@ -35,14 +35,14 @@ ckan-publish: docker push codeforafrica/ckan:$(CKAN_VERSION) solr: - docker buildx build --platform linux/amd64 --no-cache --build-arg CKAN_VERSION=$(CKAN_VERSION) -t codeforafrica/ckan-solr:latest -t codeforafrica/ckan-solr:$(SOLR_IMAGE_VERSION) contrib/solr + docker buildx build --platform linux/amd64 --no-cache --build-arg CKAN_VERSION=$(CKAN_VERSION) --tag codeforafrica/ckan-solr:latest --tag codeforafrica/ckan-solr:$(CKAN_SOLR_VERSION) contrib/solr solr-publish: docker push codeforafrica/ckan-solr:latest - docker push codeforafrica/ckan-solr:$(SOLR_IMAGE_VERSION) + docker push codeforafrica/ckan-solr:$(CKAN_SOLR_VERSION) datapusher: - docker buildx build --platform linux/amd64 -t codeforafrica/ckan-datapusher:latest -t codeforafrica/ckan-datapusher:$(DATAPUSHER_VERSION) contrib/ckan-datapusher + docker buildx build --platform linux/amd64 --tag codeforafrica/ckan-datapusher:latest --tag codeforafrica/ckan-datapusher:$(DATAPUSHER_VERSION) contrib/ckan-datapusher datapusher-publish: docker push codeforafrica/ckan-datapusher:latest diff --git a/docker-compose.yml b/docker-compose.yml index 3d244f6..b813757 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,7 +24,10 @@ services: test: ["CMD", "pg_isready", "-U", "${POSTGRES_USER}", "-d", "${POSTGRES_DB}"] web: container_name: web - image: codeforafrica/ckan:${CKAN_VERSION} + build: + context: . + dockerfile: Dockerfile + platform: linux/amd64 depends_on: - solr - redis @@ -40,7 +43,7 @@ services: - "8800:8800" solr: - image: ckan/ckan-solr:${SOLR_IMAGE_VERSION} + image: ckan/ckan-solr:${CKAN_SOLR_VERSION} ports: - "8983:8983" volumes: