From ff392c6fbce0819608b40a56cd139b872631990f Mon Sep 17 00:00:00 2001 From: Kiril-Poposki1998 Date: Tue, 27 Aug 2024 14:02:40 +0200 Subject: [PATCH 1/2] Fix envvars and add latest version --- compose/2.10/.env | 1 + images/ckan/2.10/Dockerfile | 2 +- images/ckan/2.10/Dockerfile.focal | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/compose/2.10/.env b/compose/2.10/.env index 4556cfd..742df69 100644 --- a/compose/2.10/.env +++ b/compose/2.10/.env @@ -27,6 +27,7 @@ DATAPUSHER_DOWNLOAD_TIMEOUT=30 DATAPUSHER_SSL_VERIFY=False DATAPUSHER_REWRITE_RESOURCES=True DATAPUSHER_REWRITE_URL=http://ckan:5005 +DATAPUSHER_SSL_VERIFY=False # SOLR CKAN_CORE_NAME=ckan diff --git a/images/ckan/2.10/Dockerfile b/images/ckan/2.10/Dockerfile index d4d27e5..484ce62 100644 --- a/images/ckan/2.10/Dockerfile +++ b/images/ckan/2.10/Dockerfile @@ -74,7 +74,7 @@ ENV DEFAULT_EXTENSIONS envvars # Locations and tags, please use specific tags or revisions ENV ENVVARS_GIT_URL=https://github.com/okfn/ckanext-envvars -ENV ENVVARS_GIT_BRANCH=0.0.2 +ENV ENVVARS_GIT_BRANCH=v0.0.4 RUN apk add --no-cache \ python3 \ diff --git a/images/ckan/2.10/Dockerfile.focal b/images/ckan/2.10/Dockerfile.focal index 8402695..5d618ee 100644 --- a/images/ckan/2.10/Dockerfile.focal +++ b/images/ckan/2.10/Dockerfile.focal @@ -97,7 +97,7 @@ ENV DEFAULT_EXTENSIONS envvars # Locations and tags, please use specific tags or revisions ENV ENVVARS_GIT_URL=https://github.com/okfn/ckanext-envvars -ENV ENVVARS_GIT_BRANCH=0.0.1 +ENV ENVVARS_GIT_BRANCH=v0.0.4 RUN apt-get update && \ apt-get install --no-install-recommends -y \ From 0ee692b8f4884b987a83fffd1d15b1b8ffbd1cc8 Mon Sep 17 00:00:00 2001 From: Kiril-Poposki1998 Date: Tue, 27 Aug 2024 14:17:08 +0200 Subject: [PATCH 2/2] Add health checks for all services and update depends on the ckan service block --- compose/2.10/docker-compose.yml | 23 +++++++++++++++++++---- compose/2.11/.env | 2 +- compose/2.11/docker-compose.yml | 23 +++++++++++++++++++---- 3 files changed, 39 insertions(+), 9 deletions(-) diff --git a/compose/2.10/docker-compose.yml b/compose/2.10/docker-compose.yml index c7f08a4..74c85e3 100644 --- a/compose/2.10/docker-compose.yml +++ b/compose/2.10/docker-compose.yml @@ -12,8 +12,12 @@ services: - frontend - backend depends_on: - - db - - solr + db: + condition: service_healthy + restart: true + solr: + condition: service_healthy + restart: true ports: - "0.0.0.0:${CKAN_PORT}:5000" env_file: @@ -28,7 +32,6 @@ services: - CKAN_MAX_UPLOAD_SIZE_MB=${CKAN_MAX_UPLOAD_SIZE_MB} - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} - DS_RO_PASS=${DATASTORE_READONLY_PASSWORD} - volumes: - ckan_data:/srv/app/data @@ -45,7 +48,7 @@ services: - DATAPUSHER_CHUNK_SIZE=${DATAPUSHER_CHUNK_SIZE} - DATAPUSHER_CHUNK_INSERT_ROWS=${DATAPUSHER_CHUNK_INSERT_ROWS} - DATAPUSHER_DOWNLOAD_TIMEOUT=${DATAPUSHER_DOWNLOAD_TIMEOUT} - - DATAPUSHER_SSL_VERIFY=${DATA_PUSHER_SSL_VERIFY} + - DATAPUSHER_SSL_VERIFY=${DATAPUSHER_SSL_VERIFY} - DATAPUSHER_REWRITE_RESOURCES=${DATAPUSHER_REWRITE_RESOURCES} - DATAPUSHER_REWRITE_URL=${DATAPUSHER_REWRITE_URL} @@ -82,12 +85,24 @@ services: volumes: - solr_data:/var/solr - ${PWD}/solr8/ckan_init_solr.sh:/docker-entrypoint-initdb.d/ckan_init_solr.sh + healthcheck: + test: ["CMD-SHELL", "/opt/solr/bin/solr","status"] + interval: 5s + timeout: 5s + retries: 5 + start_period: 5s redis: container_name: redis image: redis:${REDIS_VERSION} networks: - backend + healthcheck: + test: ["CMD", "redis-cli", "--raw", "incr", "ping"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 30s networks: frontend: diff --git a/compose/2.11/.env b/compose/2.11/.env index 394a5fd..a0c157d 100644 --- a/compose/2.11/.env +++ b/compose/2.11/.env @@ -27,7 +27,7 @@ DATAPUSHER_DOWNLOAD_TIMEOUT=30 DATAPUSHER_SSL_VERIFY=False DATAPUSHER_REWRITE_RESOURCES=True DATAPUSHER_REWRITE_URL=http://ckan:5005 -DATA_PUSHER_SSL_VERIFY=False +DATAPUSHER_SSL_VERIFY=False # SOLR CKAN_CORE_NAME=ckan diff --git a/compose/2.11/docker-compose.yml b/compose/2.11/docker-compose.yml index c7f08a4..74c85e3 100644 --- a/compose/2.11/docker-compose.yml +++ b/compose/2.11/docker-compose.yml @@ -12,8 +12,12 @@ services: - frontend - backend depends_on: - - db - - solr + db: + condition: service_healthy + restart: true + solr: + condition: service_healthy + restart: true ports: - "0.0.0.0:${CKAN_PORT}:5000" env_file: @@ -28,7 +32,6 @@ services: - CKAN_MAX_UPLOAD_SIZE_MB=${CKAN_MAX_UPLOAD_SIZE_MB} - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} - DS_RO_PASS=${DATASTORE_READONLY_PASSWORD} - volumes: - ckan_data:/srv/app/data @@ -45,7 +48,7 @@ services: - DATAPUSHER_CHUNK_SIZE=${DATAPUSHER_CHUNK_SIZE} - DATAPUSHER_CHUNK_INSERT_ROWS=${DATAPUSHER_CHUNK_INSERT_ROWS} - DATAPUSHER_DOWNLOAD_TIMEOUT=${DATAPUSHER_DOWNLOAD_TIMEOUT} - - DATAPUSHER_SSL_VERIFY=${DATA_PUSHER_SSL_VERIFY} + - DATAPUSHER_SSL_VERIFY=${DATAPUSHER_SSL_VERIFY} - DATAPUSHER_REWRITE_RESOURCES=${DATAPUSHER_REWRITE_RESOURCES} - DATAPUSHER_REWRITE_URL=${DATAPUSHER_REWRITE_URL} @@ -82,12 +85,24 @@ services: volumes: - solr_data:/var/solr - ${PWD}/solr8/ckan_init_solr.sh:/docker-entrypoint-initdb.d/ckan_init_solr.sh + healthcheck: + test: ["CMD-SHELL", "/opt/solr/bin/solr","status"] + interval: 5s + timeout: 5s + retries: 5 + start_period: 5s redis: container_name: redis image: redis:${REDIS_VERSION} networks: - backend + healthcheck: + test: ["CMD", "redis-cli", "--raw", "incr", "ping"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 30s networks: frontend: