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/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..1b8223f 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) --tag codeforafrica/ckan:latest --tag codeforafrica/ckan:$(CKAN_VERSION) . 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) --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:2.8.11 - + docker push codeforafrica/ckan-solr:$(CKAN_SOLR_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 --tag codeforafrica/ckan-datapusher:latest --tag 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..b813757 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -27,24 +27,23 @@ services: build: context: . dockerfile: Dockerfile + platform: linux/amd64 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:${CKAN_SOLR_VERSION} ports: - "8983:8983" volumes: