diff --git a/compose/2.10/.ckan-env b/compose/2.10/.ckan-env deleted file mode 100644 index b9f2598..0000000 --- a/compose/2.10/.ckan-env +++ /dev/null @@ -1,42 +0,0 @@ -# Runtime configuration of CKAN enabled through ckanext-envvars -# Information about how it works: https://github.com/okfn/ckanext-envvars -# Note that variables here take presedence over build/up time variables in .env - -# Set to true to disable CKAN from starting and serve a maintenance page -MAINTENANCE_MODE=false - -# General Settings -CKAN_SITE_ID=default -CKAN_SITE_URL=http://localhost:5000 -CKAN_PORT=5000 -CKAN_MAX_UPLOAD_SIZE_MB=20 -CKAN___BEAKER__SESSION__SECRET=CHANGE_ME -# See https://docs.ckan.org/en/latest/maintaining/configuration.html#api-token-settings -CKAN___API_TOKEN__JWT__ENCODE__SECRET=string:CHANGE_ME -CKAN___API_TOKEN__JWT__DECODE__SECRET=string:CHANGE_ME -# CKAN Plugins -CKAN__PLUGINS=envvars image_view text_view recline_view datastore datapusher -# CKAN requires storage path to be set in order for filestore to be enabled -CKAN__STORAGE_PATH=/srv/app/data -CKAN__WEBASSETS__PATH=/srv/app/data/webassets -# SYSADMIN settings, a sysadmin user is created automatically with the below credentials -CKAN_SYSADMIN_NAME=sysadmin -CKAN_SYSADMIN_PASSWORD=password -CKAN_SYSADMIN_EMAIL=sysadmin@ckantest.com - -# Email settings -CKAN_SMTP_SERVER=smtp.corporateict.domain:25 -CKAN_SMTP_STARTTLS=True -CKAN_SMTP_USER=user -CKAN_SMTP_PASSWORD=pass -CKAN_SMTP_MAIL_FROM=ckan@localhost - -# Datapusher configuration -CKAN__DATAPUSHER__URL=http://datapusher:8000 -CKAN__DATAPUSHER__CALLBACK_URL_BASE=http://ckan:5000/ -CKAN__DATAPUSHER__API_TOKEN=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJ6M0lGRGw4SVdFR3lVRzFYRHJ0cm56WmNmcDlzbmFuUHlUMjdqLXRVSW9nIiwiaWF0IjoxNjc3MDYwNjQ1fQ.ECCa0wU-FOOGpdE9_TTVj__2J9SfANRBD6gRClBvPk0 -# CKAN__DATAPUSHER__API_TOKEN=replace_this_with_api_token_once_ckan_starts - -# Solr configuration -CKAN_VERSION=2.10 -CKAN_CORE_NAME=ckan \ No newline at end of file diff --git a/compose/2.10/.env b/compose/2.10/.env deleted file mode 100644 index 742df69..0000000 --- a/compose/2.10/.env +++ /dev/null @@ -1,36 +0,0 @@ -# Variables in this file will be used as build arguments when running -# docker-compose build and docker-compose up -# Verify correct substitution with "docker-compose config" -# If variables are newly added or enabled, please delete and rebuild the images to pull in changes: -# docker-compose down -v -# docker-compose build -# docker-compose up -d - -# Database -POSTGRES_PASSWORD=ckan -POSTGRES_PORT=5432 -DATASTORE_READONLY_PASSWORD=datastore - -# CKAN -CKAN_VERSION=2.10.5 -CKAN_SITE_ID=default -CKAN_SITE_URL=http://localhost:5000 -CKAN_PORT=5000 -CKAN_MAX_UPLOAD_SIZE_MB=10 - -# Datapusher -DATAPUSHER_VERSION=0.0.17 -DATAPUSHER_MAX_CONTENT_LENGTH=10485760 -DATAPUSHER_CHUNK_SIZE=16384 -DATAPUSHER_CHUNK_INSERT_ROWS=250 -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 - -# Redis -REDIS_VERSION=6.0.7 diff --git a/compose/2.10/docker-compose.yml b/compose/2.10/docker-compose.yml deleted file mode 100644 index 74c85e3..0000000 --- a/compose/2.10/docker-compose.yml +++ /dev/null @@ -1,109 +0,0 @@ -# docker-compose build && docker-compose up -d -volumes: - ckan_data: - pg_data: - solr_data: - -services: - ckan: - container_name: ckan - image: ghcr.io/keitaroinc/ckan:${CKAN_VERSION} - networks: - - frontend - - backend - depends_on: - db: - condition: service_healthy - restart: true - solr: - condition: service_healthy - restart: true - ports: - - "0.0.0.0:${CKAN_PORT}:5000" - env_file: - - ./.ckan-env - environment: - - CKAN_SQLALCHEMY_URL=postgresql://ckan:${POSTGRES_PASSWORD}@db/ckan - - CKAN_DATASTORE_WRITE_URL=postgresql://ckan:${POSTGRES_PASSWORD}@db/datastore - - CKAN_DATASTORE_READ_URL=postgresql://datastore_ro:${DATASTORE_READONLY_PASSWORD}@db/datastore - - CKAN_SOLR_URL=http://solr:8983/solr/ckan - - CKAN_REDIS_URL=redis://redis:6379/1 - - CKAN_SITE_URL=${CKAN_SITE_URL} - - 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 - - datapusher: - container_name: datapusher - image: ghcr.io/keitaroinc/datapusher:${DATAPUSHER_VERSION} - networks: - - frontend - - backend - ports: - - "8000:8000" - environment: - - DATAPUSHER_MAX_CONTENT_LENGTH=${DATAPUSHER_MAX_CONTENT_LENGTH} - - DATAPUSHER_CHUNK_SIZE=${DATAPUSHER_CHUNK_SIZE} - - DATAPUSHER_CHUNK_INSERT_ROWS=${DATAPUSHER_CHUNK_INSERT_ROWS} - - DATAPUSHER_DOWNLOAD_TIMEOUT=${DATAPUSHER_DOWNLOAD_TIMEOUT} - - DATAPUSHER_SSL_VERIFY=${DATAPUSHER_SSL_VERIFY} - - DATAPUSHER_REWRITE_RESOURCES=${DATAPUSHER_REWRITE_RESOURCES} - - DATAPUSHER_REWRITE_URL=${DATAPUSHER_REWRITE_URL} - - - db: - container_name: db - build: - context: . - dockerfile: postgresql/Dockerfile - args: - - DS_RO_PASS=${DATASTORE_READONLY_PASSWORD} - - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} - networks: - - backend - environment: - - DS_RO_PASS=${DATASTORE_READONLY_PASSWORD} - - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} - - PGDATA=/var/lib/postgresql/data/db - volumes: - - pg_data:/var/lib/postgresql/data - healthcheck: - test: ["CMD", "pg_isready", "-U", "ckan"] - - solr: - container_name: solr - image: solr:8.11.1 - networks: - - backend - env_file: - - ./.ckan-env - environment: - - CKAN_CORE_NAME=${CKAN_CORE_NAME} - - CKAN_VERSION=${CKAN_VERSION} - 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: - backend: diff --git a/compose/2.10/postgresql/Dockerfile b/compose/2.10/postgresql/Dockerfile deleted file mode 100644 index e5fcbb7..0000000 --- a/compose/2.10/postgresql/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM postgis/postgis:14-3.2-alpine - -# Allow connections; we don't map out any ports so only linked docker containers can connect -RUN echo "host all all 0.0.0.0/0 md5" >> /var/lib/postgresql/data/pg_hba.conf - -# Customize default user/pass/db -ENV POSTGRES_DB ckan -ENV POSTGRES_USER ckan -ARG POSTGRES_PASSWORD -ARG DS_RO_PASS - -# Include datastore setup scripts -COPY ./postgresql/docker-entrypoint-initdb.d /docker-entrypoint-initdb.d diff --git a/compose/2.10/solr8/ckan_init_solr.sh b/compose/2.10/solr8/ckan_init_solr.sh deleted file mode 100755 index 091450f..0000000 --- a/compose/2.10/solr8/ckan_init_solr.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -# -# Initialize SOLR for CKAN by creating a ckan core -# Arguments are supplied via environment variables: CKAN_CORE_NAME CKAN_VERSION -# Example: -# CKAN_CORE_NAME=ckan -# CKAN_VERSION=2.9.7 - -set -e - -MAJOR_VERSION=`echo $CKAN_VERSION | cut -d "." -f 1` -MINOR_VERSION=`echo $CKAN_VERSION | cut -d "." -f 2` - -CKAN_SOLR_SCHEMA_URL=https://raw.githubusercontent.com/ckan/ckan/`echo $MAJOR_VERSION.$MINOR_VERSION`/ckan/config/solr/schema.xml - -echo "Check whether managed schema exists for CKAN $CKAN_VERSION" -if ! curl --output /dev/null --silent --head --fail "$CKAN_SOLR_SCHEMA_URL"; then - echo "Can't find CKAN SOLR schema at URL: $CKAN_SOLR_SCHEMA_URL. Exiting..." - exit 1 -fi - -echo "Check whether SOLR is initialized for CKAN" -CORESDIR=/var/solr/data - -COREDIR="$CORESDIR/$CKAN_CORE_NAME" -if [ -d "$COREDIR" ]; then - echo "SOLR already initialized, skipping initialization" -else - echo "Initializing SOLR core $CKAN_CORE_NAME for CKAN $CKAN_VERSION" - # init script for handling an empty /var/solr - /opt/docker-solr/scripts/init-var-solr - - # Precreate CKAN core - /opt/docker-solr/scripts/precreate-core $CKAN_CORE_NAME - - # Replace the managed schema with CKANs schema - echo "Adding CKAN managed schema" - curl $CKAN_SOLR_SCHEMA_URL -o /var/solr/data/$CKAN_CORE_NAME/conf/managed-schema -s - - echo "SOLR initialized" -fi diff --git a/compose/2.11/.env b/compose/2.11/.env deleted file mode 100644 index a0c157d..0000000 --- a/compose/2.11/.env +++ /dev/null @@ -1,36 +0,0 @@ -# Variables in this file will be used as build arguments when running -# docker-compose build and docker-compose up -# Verify correct substitution with "docker-compose config" -# If variables are newly added or enabled, please delete and rebuild the images to pull in changes: -# docker-compose down -v -# docker-compose build -# docker-compose up -d - -# Database -POSTGRES_PASSWORD=ckan -POSTGRES_PORT=5432 -DATASTORE_READONLY_PASSWORD=datastore - -# CKAN -CKAN_VERSION=2.11.0 -CKAN_SITE_ID=default -CKAN_SITE_URL=http://localhost:5000 -CKAN_PORT=5000 -CKAN_MAX_UPLOAD_SIZE_MB=10 - -# Datapusher -DATAPUSHER_VERSION=0.0.17 -DATAPUSHER_MAX_CONTENT_LENGTH=10485760 -DATAPUSHER_CHUNK_SIZE=16384 -DATAPUSHER_CHUNK_INSERT_ROWS=250 -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 - -# Redis -REDIS_VERSION=6.0.7 diff --git a/compose/2.11/docker-compose.yml b/compose/2.11/docker-compose.yml deleted file mode 100644 index 74c85e3..0000000 --- a/compose/2.11/docker-compose.yml +++ /dev/null @@ -1,109 +0,0 @@ -# docker-compose build && docker-compose up -d -volumes: - ckan_data: - pg_data: - solr_data: - -services: - ckan: - container_name: ckan - image: ghcr.io/keitaroinc/ckan:${CKAN_VERSION} - networks: - - frontend - - backend - depends_on: - db: - condition: service_healthy - restart: true - solr: - condition: service_healthy - restart: true - ports: - - "0.0.0.0:${CKAN_PORT}:5000" - env_file: - - ./.ckan-env - environment: - - CKAN_SQLALCHEMY_URL=postgresql://ckan:${POSTGRES_PASSWORD}@db/ckan - - CKAN_DATASTORE_WRITE_URL=postgresql://ckan:${POSTGRES_PASSWORD}@db/datastore - - CKAN_DATASTORE_READ_URL=postgresql://datastore_ro:${DATASTORE_READONLY_PASSWORD}@db/datastore - - CKAN_SOLR_URL=http://solr:8983/solr/ckan - - CKAN_REDIS_URL=redis://redis:6379/1 - - CKAN_SITE_URL=${CKAN_SITE_URL} - - 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 - - datapusher: - container_name: datapusher - image: ghcr.io/keitaroinc/datapusher:${DATAPUSHER_VERSION} - networks: - - frontend - - backend - ports: - - "8000:8000" - environment: - - DATAPUSHER_MAX_CONTENT_LENGTH=${DATAPUSHER_MAX_CONTENT_LENGTH} - - DATAPUSHER_CHUNK_SIZE=${DATAPUSHER_CHUNK_SIZE} - - DATAPUSHER_CHUNK_INSERT_ROWS=${DATAPUSHER_CHUNK_INSERT_ROWS} - - DATAPUSHER_DOWNLOAD_TIMEOUT=${DATAPUSHER_DOWNLOAD_TIMEOUT} - - DATAPUSHER_SSL_VERIFY=${DATAPUSHER_SSL_VERIFY} - - DATAPUSHER_REWRITE_RESOURCES=${DATAPUSHER_REWRITE_RESOURCES} - - DATAPUSHER_REWRITE_URL=${DATAPUSHER_REWRITE_URL} - - - db: - container_name: db - build: - context: . - dockerfile: postgresql/Dockerfile - args: - - DS_RO_PASS=${DATASTORE_READONLY_PASSWORD} - - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} - networks: - - backend - environment: - - DS_RO_PASS=${DATASTORE_READONLY_PASSWORD} - - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} - - PGDATA=/var/lib/postgresql/data/db - volumes: - - pg_data:/var/lib/postgresql/data - healthcheck: - test: ["CMD", "pg_isready", "-U", "ckan"] - - solr: - container_name: solr - image: solr:8.11.1 - networks: - - backend - env_file: - - ./.ckan-env - environment: - - CKAN_CORE_NAME=${CKAN_CORE_NAME} - - CKAN_VERSION=${CKAN_VERSION} - 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: - backend: diff --git a/compose/2.11/postgresql/docker-entrypoint-initdb.d/00_create_datastore.sh b/compose/2.11/postgresql/docker-entrypoint-initdb.d/00_create_datastore.sh deleted file mode 100644 index ec1b3c3..0000000 --- a/compose/2.11/postgresql/docker-entrypoint-initdb.d/00_create_datastore.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -set -e - -psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL - CREATE ROLE datastore_ro NOSUPERUSER NOCREATEDB NOCREATEROLE LOGIN PASSWORD '$DS_RO_PASS'; - CREATE DATABASE datastore OWNER ckan ENCODING 'utf-8'; - GRANT ALL PRIVILEGES ON DATABASE datastore TO ckan; -EOSQL \ No newline at end of file diff --git a/compose/2.11/postgresql/docker-entrypoint-initdb.d/20_postgis_permissions.sql b/compose/2.11/postgresql/docker-entrypoint-initdb.d/20_postgis_permissions.sql deleted file mode 100644 index 8b5348e..0000000 --- a/compose/2.11/postgresql/docker-entrypoint-initdb.d/20_postgis_permissions.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER VIEW geometry_columns OWNER TO ckan; -ALTER TABLE spatial_ref_sys OWNER TO ckan; diff --git a/compose/2.11/solr8/ckan_init_solr.sh b/compose/2.11/solr8/ckan_init_solr.sh deleted file mode 100755 index 091450f..0000000 --- a/compose/2.11/solr8/ckan_init_solr.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -# -# Initialize SOLR for CKAN by creating a ckan core -# Arguments are supplied via environment variables: CKAN_CORE_NAME CKAN_VERSION -# Example: -# CKAN_CORE_NAME=ckan -# CKAN_VERSION=2.9.7 - -set -e - -MAJOR_VERSION=`echo $CKAN_VERSION | cut -d "." -f 1` -MINOR_VERSION=`echo $CKAN_VERSION | cut -d "." -f 2` - -CKAN_SOLR_SCHEMA_URL=https://raw.githubusercontent.com/ckan/ckan/`echo $MAJOR_VERSION.$MINOR_VERSION`/ckan/config/solr/schema.xml - -echo "Check whether managed schema exists for CKAN $CKAN_VERSION" -if ! curl --output /dev/null --silent --head --fail "$CKAN_SOLR_SCHEMA_URL"; then - echo "Can't find CKAN SOLR schema at URL: $CKAN_SOLR_SCHEMA_URL. Exiting..." - exit 1 -fi - -echo "Check whether SOLR is initialized for CKAN" -CORESDIR=/var/solr/data - -COREDIR="$CORESDIR/$CKAN_CORE_NAME" -if [ -d "$COREDIR" ]; then - echo "SOLR already initialized, skipping initialization" -else - echo "Initializing SOLR core $CKAN_CORE_NAME for CKAN $CKAN_VERSION" - # init script for handling an empty /var/solr - /opt/docker-solr/scripts/init-var-solr - - # Precreate CKAN core - /opt/docker-solr/scripts/precreate-core $CKAN_CORE_NAME - - # Replace the managed schema with CKANs schema - echo "Adding CKAN managed schema" - curl $CKAN_SOLR_SCHEMA_URL -o /var/solr/data/$CKAN_CORE_NAME/conf/managed-schema -s - - echo "SOLR initialized" -fi diff --git a/compose/2.8/.ckan-env b/compose/2.8/.ckan-env deleted file mode 100644 index 6e37970..0000000 --- a/compose/2.8/.ckan-env +++ /dev/null @@ -1,36 +0,0 @@ -# Runtime configuration of CKAN enabled through ckanext-envvars -# Information about how it works: https://github.com/okfn/ckanext-envvars -# Note that variables here take presedence over build/up time variables in .env - -# Set to true to disable CKAN from starting and serve a maintenance page -MAINTENANCE_MODE=false - -# General Settings -CKAN_SITE_ID=default -CKAN_SITE_URL=http://localhost:5000 -CKAN_PORT=5000 -CKAN_MAX_UPLOAD_SIZE_MB=10 -CKAN___BEAKER__SESSION__SECRET=CHANGE_ME -# See https://docs.ckan.org/en/latest/maintaining/configuration.html#api-token-settings -CKAN___API_TOKEN__JWT__ENCODE__SECRET=string:CHANGE_ME -CKAN___API_TOKEN__JWT__DECODE__SECRET=string:CHANGE_ME -# CKAN Plugins -CKAN__PLUGINS=envvars image_view text_view recline_view datastore datapusher -# CKAN requires storage path to be set in order for filestore to be enabled -CKAN__STORAGE_PATH=/srv/app/data -CKAN__WEBASSETS__PATH=/srv/app/data/webassets -# SYSADMIN settings, a sysadmin user is created automatically with the below credentials -CKAN_SYSADMIN_NAME=sysadmin -CKAN_SYSADMIN_PASSWORD=password -CKAN_SYSADMIN_EMAIL=sysadmin@ckantest.com - -# Email settings -CKAN_SMTP_SERVER=smtp.corporateict.domain:25 -CKAN_SMTP_STARTTLS=True -CKAN_SMTP_USER=user -CKAN_SMTP_PASSWORD=pass -CKAN_SMTP_MAIL_FROM=ckan@localhost - -# Datapusher configuration -CKAN__DATAPUSHER__URL=http://datapusher:8000 -CKAN__DATAPUSHER__CALLBACK_URL_BASE=http://ckan:5000/ diff --git a/compose/2.8/.env b/compose/2.8/.env deleted file mode 100644 index 83b4c85..0000000 --- a/compose/2.8/.env +++ /dev/null @@ -1,32 +0,0 @@ -# Variables in this file will be used as build arguments when running -# docker-compose build and docker-compose up -# Verify correct substitution with "docker-compose config" -# If variables are newly added or enabled, please delete and rebuild the images to pull in changes: -# docker-compose down -v -# docker-compose build -# docker-compose up -d - -# Database -POSTGRES_PASSWORD=ckan -POSTGRES_PORT=5432 -DATASTORE_READONLY_PASSWORD=datastore - -# CKAN -CKAN_VERSION=2.8.12 -CKAN_SITE_ID=default -CKAN_SITE_URL=http://localhost:5000 -CKAN_PORT=5000 -CKAN_MAX_UPLOAD_SIZE_MB=10 - -# Datapusher -DATAPUSHER_VERSION=0.0.17 -DATAPUSHER_MAX_CONTENT_LENGTH=10485760 -DATAPUSHER_CHUNK_SIZE=16384 -DATAPUSHER_CHUNK_INSERT_ROWS=250 -DATAPUSHER_DOWNLOAD_TIMEOUT=30 -DATAPUSHER_SSL_VERIFY=False -DATAPUSHER_REWRITE_RESOURCES=True -DATAPUSHER_REWRITE_URL=http://ckan:5000 - -# Redis -REDIS_VERSION=6.0.7 diff --git a/compose/2.8/docker-compose.yml b/compose/2.8/docker-compose.yml deleted file mode 100644 index 18c7b36..0000000 --- a/compose/2.8/docker-compose.yml +++ /dev/null @@ -1,93 +0,0 @@ -# docker-compose build && docker-compose up -d -version: "3" - -volumes: - ckan_data: - pg_data: - solr_data: - -services: - ckan: - container_name: ckan - image: ghcr.io/keitaroinc/ckan:${CKAN_VERSION} - networks: - - frontend - - backend - depends_on: - - db - - solr - ports: - - "0.0.0.0:${CKAN_PORT}:5000" - env_file: - - ./.ckan-env - environment: - - CKAN_SQLALCHEMY_URL=postgresql://ckan:${POSTGRES_PASSWORD}@db/ckan - - CKAN_DATASTORE_WRITE_URL=postgresql://ckan:${POSTGRES_PASSWORD}@db/datastore - - CKAN_DATASTORE_READ_URL=postgresql://datastore_ro:${DATASTORE_READONLY_PASSWORD}@db/datastore - - CKAN_SOLR_URL=http://solr:8983/solr/ckan - - CKAN_REDIS_URL=redis://redis:6379/1 - - CKAN_SITE_URL=${CKAN_SITE_URL} - - 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 - - datapusher: - container_name: datapusher - image: ghcr.io/keitaroinc/datapusher:${DATAPUSHER_VERSION} - networks: - - frontend - - backend - ports: - - "8000:8000" - environment: - - DATAPUSHER_MAX_CONTENT_LENGTH=${DATAPUSHER_MAX_CONTENT_LENGTH} - - 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_REWRITE_RESOURCES=${DATAPUSHER_REWRITE_RESOURCES} - - DATAPUSHER_REWRITE_URL=${DATAPUSHER_REWRITE_URL} - - - db: - container_name: db - build: - context: . - dockerfile: postgresql/Dockerfile - args: - - DS_RO_PASS=${DATASTORE_READONLY_PASSWORD} - - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} - networks: - - backend - environment: - - DS_RO_PASS=${DATASTORE_READONLY_PASSWORD} - - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} - - PGDATA=/var/lib/postgresql/data/db - volumes: - - pg_data:/var/lib/postgresql/data - healthcheck: - test: ["CMD", "pg_isready", "-U", "ckan"] - - solr: - container_name: solr - build: - context: . - dockerfile: solr/Dockerfile - args: - - CKAN_VERSION=${CKAN_VERSION} - networks: - - backend - volumes: - - solr_data:/opt/solr/server/solr/ckan/data - - redis: - container_name: redis - image: redis:${REDIS_VERSION} - networks: - - backend - -networks: - frontend: - backend: diff --git a/compose/2.8/postgresql/Dockerfile b/compose/2.8/postgresql/Dockerfile deleted file mode 100644 index 95e8cf6..0000000 --- a/compose/2.8/postgresql/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM postgis/postgis:11-3.3-alpine - -# Allow connections; we don't map out any ports so only linked docker containers can connect -RUN echo "host all all 0.0.0.0/0 md5" >> /var/lib/postgresql/data/pg_hba.conf - -# Customize default user/pass/db -ENV POSTGRES_DB ckan -ENV POSTGRES_USER ckan -ARG POSTGRES_PASSWORD -ARG DS_RO_PASS - -# Include datastore setup scripts -COPY ./postgresql/docker-entrypoint-initdb.d /docker-entrypoint-initdb.d diff --git a/compose/2.8/postgresql/docker-entrypoint-initdb.d/00_create_datastore.sh b/compose/2.8/postgresql/docker-entrypoint-initdb.d/00_create_datastore.sh deleted file mode 100644 index ec1b3c3..0000000 --- a/compose/2.8/postgresql/docker-entrypoint-initdb.d/00_create_datastore.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -set -e - -psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL - CREATE ROLE datastore_ro NOSUPERUSER NOCREATEDB NOCREATEROLE LOGIN PASSWORD '$DS_RO_PASS'; - CREATE DATABASE datastore OWNER ckan ENCODING 'utf-8'; - GRANT ALL PRIVILEGES ON DATABASE datastore TO ckan; -EOSQL \ No newline at end of file diff --git a/compose/2.8/postgresql/docker-entrypoint-initdb.d/20_postgis_permissions.sql b/compose/2.8/postgresql/docker-entrypoint-initdb.d/20_postgis_permissions.sql deleted file mode 100644 index 8b5348e..0000000 --- a/compose/2.8/postgresql/docker-entrypoint-initdb.d/20_postgis_permissions.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER VIEW geometry_columns OWNER TO ckan; -ALTER TABLE spatial_ref_sys OWNER TO ckan; diff --git a/compose/2.8/solr/Dockerfile b/compose/2.8/solr/Dockerfile deleted file mode 100644 index 6cdbae2..0000000 --- a/compose/2.8/solr/Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -FROM solr:6.6.6 - -# Enviroment -ENV SOLR_CORE ckan -ENV SOLR_VERSION 6.6.6 - -# Build Arguments -ARG CKAN_VERSION - -# Create Directories -RUN mkdir -p /opt/solr/server/solr/$SOLR_CORE/conf -RUN mkdir -p /opt/solr/server/solr/$SOLR_CORE/data - -# Adding Files -COPY ./solr/solrconfig-$CKAN_VERSION.xml /opt/solr/server/solr/$SOLR_CORE/conf/ -ADD https://raw.githubusercontent.com/ckan/ckan/ckan-$CKAN_VERSION/ckan/config/solr/schema.xml \ -https://raw.githubusercontent.com/apache/lucene-solr/releases/lucene-solr/$SOLR_VERSION/solr/server/solr/configsets/basic_configs/conf/currency.xml \ -https://raw.githubusercontent.com/apache/lucene-solr/releases/lucene-solr/$SOLR_VERSION/solr/server/solr/configsets/basic_configs/conf/synonyms.txt \ -https://raw.githubusercontent.com/apache/lucene-solr/releases/lucene-solr/$SOLR_VERSION/solr/server/solr/configsets/basic_configs/conf/stopwords.txt \ -https://raw.githubusercontent.com/apache/lucene-solr/releases/lucene-solr/$SOLR_VERSION/solr/server/solr/configsets/basic_configs/conf/protwords.txt \ -https://raw.githubusercontent.com/apache/lucene-solr/releases/lucene-solr/$SOLR_VERSION/solr/server/solr/configsets/data_driven_schema_configs/conf/elevate.xml \ -/opt/solr/server/solr/$SOLR_CORE/conf/ - -# Create Core.properties -RUN mv /opt/solr/server/solr/$SOLR_CORE/conf/solrconfig-$CKAN_VERSION.xml /opt/solr/server/solr/$SOLR_CORE/conf/solrconfig.xml && \ - echo name=$SOLR_CORE > /opt/solr/server/solr/$SOLR_CORE/core.properties - -# Giving ownership to Solr - -USER root - -RUN chown -R "$SOLR_USER:$SOLR_USER" /opt/solr/server/solr/$SOLR_CORE - -# User -USER $SOLR_USER:$SOLR_USER diff --git a/compose/2.8/solr/solrconfig-2.7.12.xml b/compose/2.8/solr/solrconfig-2.7.12.xml deleted file mode 120000 index 6e325cc..0000000 --- a/compose/2.8/solr/solrconfig-2.7.12.xml +++ /dev/null @@ -1 +0,0 @@ -solrconfig-2.8.10.xml \ No newline at end of file diff --git a/compose/2.8/solr/solrconfig-2.8.12.xml b/compose/2.8/solr/solrconfig-2.8.12.xml deleted file mode 100644 index 9ac620c..0000000 --- a/compose/2.8/solr/solrconfig-2.8.12.xml +++ /dev/null @@ -1,343 +0,0 @@ - - - - - - 6.0.0 - - - - - - - - - - - ${solr.data.dir:} - - - - - - - ${solr.lock.type:native} - - - - - - - - ${solr.ulog.dir:} - ${solr.ulog.numVersionBuckets:65536} - - - - ${solr.autoCommit.maxTime:15000} - false - - - - ${solr.autoSoftCommit.maxTime:-1} - - - - - - - 1024 - - - - - true - 20 - 200 - - - - - - - - - - false - 2 - - - - - - - - - - - - - - explicit - 10 - - - - - - - - explicit - json - true - - - - - - - - explicit - - - - - - - - _text_ - - - - - - - - add-unknown-fields-to-the-schema - - - - - - - - true - ignored_ - _text_ - - - - - - - - - - - explicit - true - - - - - - - text_general - - - default - _text_ - solr.DirectSolrSpellChecker - internal - 0.5 - 2 - 1 - 5 - 4 - 0.01 - - - - - - - - default - on - true - 10 - 5 - 5 - true - true - 10 - 5 - - - - spellcheck - - - - - - - - - - true - - - tvComponent - - - - - - - - - - true - false - - - - terms - - - - - - - string - elevate.xml - - - - - - - explicit - - - elevator - - - - - - - - - - - 100 - - - - - - 70 - 0.5 - [-\w ,/\n\"']{20,200} - - - - - - ]]> - ]]> - - - - - - - - - - - - ,, - ,, - ,, - ,, - ,]]> - ]]> - - - - - - - 10 - .,!? - - - - - - WORD - en - US - - - - - - - - - - - - - - - - [^\w-\.] - _ - - - - - - - yyyy-MM-dd'T'HH:mm:ss.SSSZ - yyyy-MM-dd'T'HH:mm:ss,SSSZ - yyyy-MM-dd'T'HH:mm:ss.SSS - yyyy-MM-dd'T'HH:mm:ss,SSS - yyyy-MM-dd'T'HH:mm:ssZ - yyyy-MM-dd'T'HH:mm:ss - yyyy-MM-dd'T'HH:mmZ - yyyy-MM-dd'T'HH:mm - yyyy-MM-dd HH:mm:ss.SSSZ - yyyy-MM-dd HH:mm:ss,SSSZ - yyyy-MM-dd HH:mm:ss.SSS - yyyy-MM-dd HH:mm:ss,SSS - yyyy-MM-dd HH:mm:ssZ - yyyy-MM-dd HH:mm:ss - yyyy-MM-dd HH:mmZ - yyyy-MM-dd HH:mm - yyyy-MM-dd - - - - - - - text/plain; charset=UTF-8 - - - - ${velocity.template.base.dir:} - ${velocity.solr.resource.loader.enabled:true} - ${velocity.params.resource.loader.enabled:false} - - - - 5 - - - diff --git a/compose/2.8/solr/solrconfig-2.9.7.xml b/compose/2.8/solr/solrconfig-2.9.7.xml deleted file mode 100644 index 8a3eade..0000000 --- a/compose/2.8/solr/solrconfig-2.9.7.xml +++ /dev/null @@ -1,345 +0,0 @@ - - - - - - 6.0.0 - - - - - - - - - - - ${solr.data.dir:} - - - - - - - ${solr.lock.type:native} - - - - - - - - ${solr.ulog.dir:} - ${solr.ulog.numVersionBuckets:65536} - - - - ${solr.autoCommit.maxTime:15000} - false - - - - ${solr.autoSoftCommit.maxTime:-1} - - - - - - - 1024 - - - - - true - 20 - 200 - - - - - - - - - - false - 2 - - - - - - - - - - - - - - explicit - 10 - - - - - - - - explicit - json - true - - - - - - - - explicit - - - - - - - - _text_ - - - - - - - - add-unknown-fields-to-the-schema - - - - - - - - true - ignored_ - _text_ - - - - - - - - - - - explicit - true - - - - - - - text_general - - - default - _text_ - solr.DirectSolrSpellChecker - internal - 0.5 - 2 - 1 - 5 - 4 - 0.01 - - - - - - - - default - on - true - 10 - 5 - 5 - true - true - 10 - 5 - - - - spellcheck - - - - - - - - - - true - - - tvComponent - - - - - - - - - - true - false - - - - terms - - - - - - - string - elevate.xml - - - - - - - explicit - - - elevator - - - - - - - - - - - 100 - - - - - - 70 - 0.5 - [-\w ,/\n\"']{20,200} - - - - - - ]]> - ]]> - - - - - - - - - - - - ,, - ,, - ,, - ,, - ,]]> - ]]> - - - - - - - 10 - .,!? - - - - - - WORD - en - US - - - - - - - - - true - - - - - - - - - [^\w-\.] - _ - - - - - - - yyyy-MM-dd'T'HH:mm:ss.SSSZ - yyyy-MM-dd'T'HH:mm:ss,SSSZ - yyyy-MM-dd'T'HH:mm:ss.SSS - yyyy-MM-dd'T'HH:mm:ss,SSS - yyyy-MM-dd'T'HH:mm:ssZ - yyyy-MM-dd'T'HH:mm:ss - yyyy-MM-dd'T'HH:mmZ - yyyy-MM-dd'T'HH:mm - yyyy-MM-dd HH:mm:ss.SSSZ - yyyy-MM-dd HH:mm:ss,SSSZ - yyyy-MM-dd HH:mm:ss.SSS - yyyy-MM-dd HH:mm:ss,SSS - yyyy-MM-dd HH:mm:ssZ - yyyy-MM-dd HH:mm:ss - yyyy-MM-dd HH:mmZ - yyyy-MM-dd HH:mm - yyyy-MM-dd - - - - - - - text/plain; charset=UTF-8 - - - - ${velocity.template.base.dir:} - ${velocity.solr.resource.loader.enabled:true} - ${velocity.params.resource.loader.enabled:false} - - - - 5 - - - diff --git a/compose/2.8/solr/solrconfig-2.9.8.xml b/compose/2.8/solr/solrconfig-2.9.8.xml deleted file mode 100644 index 9b90496..0000000 --- a/compose/2.8/solr/solrconfig-2.9.8.xml +++ /dev/null @@ -1,203 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -index_id - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/compose/2.9/.ckan-env b/compose/2.9/.ckan-env deleted file mode 100644 index c264a1c..0000000 --- a/compose/2.9/.ckan-env +++ /dev/null @@ -1,40 +0,0 @@ -# Runtime configuration of CKAN enabled through ckanext-envvars -# Information about how it works: https://github.com/okfn/ckanext-envvars -# Note that variables here take presedence over build/up time variables in .env - -# Set to true to disable CKAN from starting and serve a maintenance page -MAINTENANCE_MODE=false - -# General Settings -CKAN_SITE_ID=default -CKAN_SITE_URL=http://localhost:5000 -CKAN_PORT=5000 -CKAN_MAX_UPLOAD_SIZE_MB=10 -CKAN___BEAKER__SESSION__SECRET=CHANGE_ME -# See https://docs.ckan.org/en/latest/maintaining/configuration.html#api-token-settings -CKAN___API_TOKEN__JWT__ENCODE__SECRET=string:CHANGE_ME -CKAN___API_TOKEN__JWT__DECODE__SECRET=string:CHANGE_ME -# CKAN Plugins -CKAN__PLUGINS=envvars image_view text_view recline_view datastore datapusher -# CKAN requires storage path to be set in order for filestore to be enabled -CKAN__STORAGE_PATH=/srv/app/data -CKAN__WEBASSETS__PATH=/srv/app/data/webassets -# SYSADMIN settings, a sysadmin user is created automatically with the below credentials -CKAN_SYSADMIN_NAME=sysadmin -CKAN_SYSADMIN_PASSWORD=password -CKAN_SYSADMIN_EMAIL=sysadmin@ckantest.com - -# Email settings -CKAN_SMTP_SERVER=smtp.corporateict.domain:25 -CKAN_SMTP_STARTTLS=True -CKAN_SMTP_USER=user -CKAN_SMTP_PASSWORD=pass -CKAN_SMTP_MAIL_FROM=ckan@localhost - -# Datapusher configuration -CKAN__DATAPUSHER__URL=http://datapusher:8000 -CKAN__DATAPUSHER__CALLBACK_URL_BASE=http://ckan:5000/ - -# Solr configuration -CKAN_VERSION=2.9.11 -CKAN_CORE_NAME=ckan diff --git a/compose/2.9/.env b/compose/2.9/.env deleted file mode 100644 index 2eba8d0..0000000 --- a/compose/2.9/.env +++ /dev/null @@ -1,35 +0,0 @@ -# Variables in this file will be used as build arguments when running -# docker-compose build and docker-compose up -# Verify correct substitution with "docker-compose config" -# If variables are newly added or enabled, please delete and rebuild the images to pull in changes: -# docker-compose down -v -# docker-compose build -# docker-compose up -d - -# Database -POSTGRES_PASSWORD=ckan -POSTGRES_PORT=5432 -DATASTORE_READONLY_PASSWORD=datastore - -# CKAN -CKAN_VERSION=2.9.11 -CKAN_SITE_ID=default -CKAN_SITE_URL=http://localhost:5000 -CKAN_PORT=5000 -CKAN_MAX_UPLOAD_SIZE_MB=10 - -# Datapusher -DATAPUSHER_VERSION=0.0.17 -DATAPUSHER_MAX_CONTENT_LENGTH=10485760 -DATAPUSHER_CHUNK_SIZE=16384 -DATAPUSHER_CHUNK_INSERT_ROWS=250 -DATAPUSHER_DOWNLOAD_TIMEOUT=30 -DATAPUSHER_SSL_VERIFY=False -DATAPUSHER_REWRITE_RESOURCES=True -DATAPUSHER_REWRITE_URL=http://ckan:5000 - -# SOLR -CKAN_CORE_NAME=ckan - -# Redis -REDIS_VERSION=6.0.7 diff --git a/compose/2.9/docker-compose.yml b/compose/2.9/docker-compose.yml deleted file mode 100644 index 95f693c..0000000 --- a/compose/2.9/docker-compose.yml +++ /dev/null @@ -1,95 +0,0 @@ -# docker-compose build && docker-compose up -d -version: "3" - -volumes: - ckan_data: - pg_data: - solr_data: - -services: - ckan: - container_name: ckan - image: ghcr.io/keitaroinc/ckan:${CKAN_VERSION} - networks: - - frontend - - backend - depends_on: - - db - - solr - ports: - - "0.0.0.0:${CKAN_PORT}:5000" - env_file: - - ./.ckan-env - environment: - - CKAN_SQLALCHEMY_URL=postgresql://ckan:${POSTGRES_PASSWORD}@db/ckan - - CKAN_DATASTORE_WRITE_URL=postgresql://ckan:${POSTGRES_PASSWORD}@db/datastore - - CKAN_DATASTORE_READ_URL=postgresql://datastore_ro:${DATASTORE_READONLY_PASSWORD}@db/datastore - - CKAN_SOLR_URL=http://solr:8983/solr/ckan - - CKAN_REDIS_URL=redis://redis:6379/1 - - CKAN_SITE_URL=${CKAN_SITE_URL} - - 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 - - datapusher: - container_name: datapusher - image: ghcr.io/keitaroinc/datapusher:${DATAPUSHER_VERSION} - networks: - - frontend - - backend - ports: - - "8000:8000" - environment: - - DATAPUSHER_MAX_CONTENT_LENGTH=${DATAPUSHER_MAX_CONTENT_LENGTH} - - 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_REWRITE_RESOURCES=${DATAPUSHER_REWRITE_RESOURCES} - - DATAPUSHER_REWRITE_URL=${DATAPUSHER_REWRITE_URL} - - - db: - container_name: db - build: - context: . - dockerfile: postgresql/Dockerfile - args: - - DS_RO_PASS=${DATASTORE_READONLY_PASSWORD} - - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} - networks: - - backend - environment: - - DS_RO_PASS=${DATASTORE_READONLY_PASSWORD} - - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} - - PGDATA=/var/lib/postgresql/data/db - volumes: - - pg_data:/var/lib/postgresql/data - healthcheck: - test: ["CMD", "pg_isready", "-U", "ckan"] - - solr: - container_name: solr - image: solr:8.11.1 - networks: - - backend - env_file: - - ./.ckan-env - environment: - - CKAN_CORE_NAME=${CKAN_CORE_NAME} - - CKAN_VERSION=${CKAN_VERSION} - volumes: - - solr_data:/var/solr - - ${PWD}/solr8/ckan_init_solr.sh:/docker-entrypoint-initdb.d/ckan_init_solr.sh - - redis: - container_name: redis - image: redis:${REDIS_VERSION} - networks: - - backend - -networks: - frontend: - backend: diff --git a/compose/2.9/postgresql/Dockerfile b/compose/2.9/postgresql/Dockerfile deleted file mode 100644 index e5fcbb7..0000000 --- a/compose/2.9/postgresql/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM postgis/postgis:14-3.2-alpine - -# Allow connections; we don't map out any ports so only linked docker containers can connect -RUN echo "host all all 0.0.0.0/0 md5" >> /var/lib/postgresql/data/pg_hba.conf - -# Customize default user/pass/db -ENV POSTGRES_DB ckan -ENV POSTGRES_USER ckan -ARG POSTGRES_PASSWORD -ARG DS_RO_PASS - -# Include datastore setup scripts -COPY ./postgresql/docker-entrypoint-initdb.d /docker-entrypoint-initdb.d diff --git a/compose/2.9/postgresql/docker-entrypoint-initdb.d/00_create_datastore.sh b/compose/2.9/postgresql/docker-entrypoint-initdb.d/00_create_datastore.sh deleted file mode 100644 index ec1b3c3..0000000 --- a/compose/2.9/postgresql/docker-entrypoint-initdb.d/00_create_datastore.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -set -e - -psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL - CREATE ROLE datastore_ro NOSUPERUSER NOCREATEDB NOCREATEROLE LOGIN PASSWORD '$DS_RO_PASS'; - CREATE DATABASE datastore OWNER ckan ENCODING 'utf-8'; - GRANT ALL PRIVILEGES ON DATABASE datastore TO ckan; -EOSQL \ No newline at end of file diff --git a/compose/2.9/postgresql/docker-entrypoint-initdb.d/20_postgis_permissions.sql b/compose/2.9/postgresql/docker-entrypoint-initdb.d/20_postgis_permissions.sql deleted file mode 100644 index 8b5348e..0000000 --- a/compose/2.9/postgresql/docker-entrypoint-initdb.d/20_postgis_permissions.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER VIEW geometry_columns OWNER TO ckan; -ALTER TABLE spatial_ref_sys OWNER TO ckan; diff --git a/compose/2.9/solr8/ckan_init_solr.sh b/compose/2.9/solr8/ckan_init_solr.sh deleted file mode 100755 index 1f8d0c9..0000000 --- a/compose/2.9/solr8/ckan_init_solr.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -# -# Initialize SOLR for CKAN by creating a ckan core -# Arguments are supplied via environment variables: CKAN_CORE_NAME CKAN_VERSION -# Example: -# CKAN_CORE_NAME=ckan -# CKAN_VERSION=2.9.11 - -set -e - -CKAN_SOLR_SCHEMA_URL=https://raw.githubusercontent.com/ckan/ckan/ckan-$CKAN_VERSION/ckan/config/solr/schema.solr8.xml - -echo "Check whether managed schema exists for CKAN $CKAN_VERSION" -if ! curl --output /dev/null --silent --head --fail "$CKAN_SOLR_SCHEMA_URL"; then - echo "Can't find CKAN SOLR schema at URL: $CKAN_SOLR_SCHEMA_URL. Exiting..." - exit 1 -fi - -echo "Check whether SOLR is initialized for CKAN" -CORESDIR=/var/solr/data - -COREDIR="$CORESDIR/$CKAN_CORE_NAME" -if [ -d "$COREDIR" ]; then - echo "SOLR already initialized, skipping initialization" -else - echo "Initializing SOLR core $CKAN_CORE_NAME for CKAN $CKAN_VERSION" - # init script for handling an empty /var/solr - /opt/docker-solr/scripts/init-var-solr - - # Precreate CKAN core - /opt/docker-solr/scripts/precreate-core $CKAN_CORE_NAME - - # Replace the managed schema with CKANs schema - echo "Adding CKAN managed schema" - curl $CKAN_SOLR_SCHEMA_URL -o /var/solr/data/$CKAN_CORE_NAME/conf/managed-schema -s - - echo "SOLR initialized" -fi diff --git a/compose/config/.global-env b/compose/config/.global-env new file mode 100644 index 0000000..1041231 --- /dev/null +++ b/compose/config/.global-env @@ -0,0 +1,11 @@ +#CKAN +CKAN_VERSION=2.11.1 + +# Redis +REDIS_VERSION=6.0.7 + +# Datapusher +DATAPUSHER_VERSION=0.0.17 + +# Solr +SOLR_VERSION=9 \ No newline at end of file diff --git a/compose/config/backend-services/.datapusher-env b/compose/config/backend-services/.datapusher-env new file mode 100644 index 0000000..8f89818 --- /dev/null +++ b/compose/config/backend-services/.datapusher-env @@ -0,0 +1,8 @@ +DATAPUSHER_MAX_CONTENT_LENGTH=10485760 +DATAPUSHER_CHUNK_SIZE=16384 +DATAPUSHER_CHUNK_INSERT_ROWS=250 +DATAPUSHER_DOWNLOAD_TIMEOUT=30 +DATAPUSHER_SSL_VERIFY=False +DATAPUSHER_REWRITE_RESOURCES=True +DATAPUSHER_REWRITE_URL=http://ckan:5005 +DATAPUSHER_SSL_VERIFY=False \ No newline at end of file diff --git a/compose/config/backend-services/.postgres-env b/compose/config/backend-services/.postgres-env new file mode 100644 index 0000000..2111e3b --- /dev/null +++ b/compose/config/backend-services/.postgres-env @@ -0,0 +1,6 @@ +# Database +POSTGRES_PASSWORD=ckan +POSTGRES_PORT=5432 +DATASTORE_READONLY_PASSWORD=datastore +PGDATA=/var/lib/postgresql/data/db + diff --git a/compose/config/backend-services/.solr-env b/compose/config/backend-services/.solr-env new file mode 100644 index 0000000..a1b833e --- /dev/null +++ b/compose/config/backend-services/.solr-env @@ -0,0 +1 @@ +CKAN_CORE_NAME=ckan \ No newline at end of file diff --git a/compose/config/backend-services/backend-services.yaml b/compose/config/backend-services/backend-services.yaml new file mode 100644 index 0000000..4295091 --- /dev/null +++ b/compose/config/backend-services/backend-services.yaml @@ -0,0 +1,61 @@ +services: + datapusher: + container_name: datapusher + image: ghcr.io/keitaroinc/datapusher:${DATAPUSHER_VERSION} + networks: + - frontend + - backend + ports: + - "8000:8000" + env_file: + - ${PWD}/config/backend-services/.datapusher-env + + db: + container_name: db + build: + context: ${PWD}/postgresql + networks: + - backend + env_file: + - ${PWD}/config/backend-services/.postgres-env + volumes: + - pg_data:/var/lib/postgresql/data + healthcheck: + test: ["CMD", "pg_isready", "-U", "ckan"] + + solr: + container_name: solr + build: + context: ${PWD}/solr + args: + CKAN_BRANCH: ckan-${CKAN_VERSION} + SOLR_VERSION: ${SOLR_VERSION} + networks: + - backend + env_file: + - ${PWD}/config/.global-env + - ${PWD}/config/backend-services/.solr-env + volumes: + - solr_data:/var/solr + 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 + +volumes: + pg_data: + solr_data: diff --git a/compose/2.11/.ckan-env b/compose/config/ckan/.env similarity index 80% rename from compose/2.11/.ckan-env rename to compose/config/ckan/.env index a329522..d1884b0 100644 --- a/compose/2.11/.ckan-env +++ b/compose/config/ckan/.env @@ -2,6 +2,16 @@ # Information about how it works: https://github.com/okfn/ckanext-envvars # Note that variables here take presedence over build/up time variables in .env +#Compose variables +# CKAN +CKAN_MAX_UPLOAD_SIZE_MB=10 +CKAN_SQLALCHEMY_URL=postgresql://ckan:${POSTGRES_PASSWORD:-ckan}@db/ckan +CKAN_DATASTORE_WRITE_URL=postgresql://ckan:${POSTGRES_PASSWORD:-ckan}@db/datastore +CKAN_DATASTORE_READ_URL=postgresql://datastore_ro:${DATASTORE_READONLY_PASSWORD:-datastore}@db/datastore +CKAN_SOLR_URL=http://solr:8983/solr/ckan +CKAN_REDIS_URL=redis://redis:6379/1 + + # Set to true to disable CKAN from starting and serve a maintenance page MAINTENANCE_MODE=false @@ -9,7 +19,6 @@ MAINTENANCE_MODE=false CKAN_SITE_ID=default CKAN_SITE_URL=http://localhost:5000 CKAN_PORT=5000 -CKAN_MAX_UPLOAD_SIZE_MB=20 CKAN___BEAKER__SESSION__SECRET=CHANGE_ME # See https://docs.ckan.org/en/latest/maintaining/configuration.html#api-token-settings CKAN___API_TOKEN__JWT__ENCODE__SECRET=string:CHANGE_ME @@ -36,7 +45,3 @@ CKAN__DATAPUSHER__URL=http://datapusher:8000 CKAN__DATAPUSHER__CALLBACK_URL_BASE=http://ckan:5000/ CKAN__DATAPUSHER__API_TOKEN=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJ6M0lGRGw4SVdFR3lVRzFYRHJ0cm56WmNmcDlzbmFuUHlUMjdqLXRVSW9nIiwiaWF0IjoxNjc3MDYwNjQ1fQ.ECCa0wU-FOOGpdE9_TTVj__2J9SfANRBD6gRClBvPk0 # CKAN__DATAPUSHER__API_TOKEN=replace_this_with_api_token_once_ckan_starts - -# Solr configuration -CKAN_VERSION=2.11 -CKAN_CORE_NAME=ckan \ No newline at end of file diff --git a/compose/config/ckan/ckan.yaml b/compose/config/ckan/ckan.yaml new file mode 100644 index 0000000..9765429 --- /dev/null +++ b/compose/config/ckan/ckan.yaml @@ -0,0 +1,24 @@ +services: + ckan: + container_name: ckan + image: ghcr.io/keitaroinc/ckan:${CKAN_VERSION} + networks: + - frontend + - backend + depends_on: + db: + condition: service_healthy + restart: true + solr: + condition: service_healthy + restart: true + ports: + - "0.0.0.0:${CKAN_PORT}:5000" + env_file: + - ${PWD}/config/backend-services/.postgres-env + - ${PWD}/config/ckan/.env + volumes: + - ckan_data:/srv/app/data + +volumes: + ckan_data: \ No newline at end of file diff --git a/compose/docker-compose.yml b/compose/docker-compose.yml new file mode 100644 index 0000000..846d549 --- /dev/null +++ b/compose/docker-compose.yml @@ -0,0 +1,16 @@ +# docker-compose build && docker-compose up -d +include: + - path: config/ckan/ckan.yaml + env_file: + - config/ckan/.env + - config/.global-env + project_directory: . + - path: config/backend-services/backend-services.yaml + env_file: + - config/backend-services/.postgres-env + - config/.global-env + project_directory: . + +networks: + frontend: + backend: diff --git a/compose/makefile b/compose/makefile new file mode 100644 index 0000000..8c5300d --- /dev/null +++ b/compose/makefile @@ -0,0 +1,9 @@ +start: + docker compose build + docker compose up -d + +prune: + docker compose down + docker volume rm compose_ckan_data + docker volume rm compose_solr_data + docker volume rm compose_pg_data \ No newline at end of file diff --git a/compose/2.11/postgresql/Dockerfile b/compose/postgresql/Dockerfile similarity index 74% rename from compose/2.11/postgresql/Dockerfile rename to compose/postgresql/Dockerfile index e5fcbb7..61538aa 100644 --- a/compose/2.11/postgresql/Dockerfile +++ b/compose/postgresql/Dockerfile @@ -6,8 +6,6 @@ RUN echo "host all all 0.0.0.0/0 md5" >> /var/lib/postgresql/data/pg_hba.co # Customize default user/pass/db ENV POSTGRES_DB ckan ENV POSTGRES_USER ckan -ARG POSTGRES_PASSWORD -ARG DS_RO_PASS # Include datastore setup scripts -COPY ./postgresql/docker-entrypoint-initdb.d /docker-entrypoint-initdb.d +COPY docker-entrypoint-initdb.d /docker-entrypoint-initdb.d \ No newline at end of file diff --git a/compose/2.10/postgresql/docker-entrypoint-initdb.d/00_create_datastore.sh b/compose/postgresql/docker-entrypoint-initdb.d/00_create_datastore.sh old mode 100644 new mode 100755 similarity index 84% rename from compose/2.10/postgresql/docker-entrypoint-initdb.d/00_create_datastore.sh rename to compose/postgresql/docker-entrypoint-initdb.d/00_create_datastore.sh index ec1b3c3..1993c48 --- a/compose/2.10/postgresql/docker-entrypoint-initdb.d/00_create_datastore.sh +++ b/compose/postgresql/docker-entrypoint-initdb.d/00_create_datastore.sh @@ -2,7 +2,7 @@ set -e psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL - CREATE ROLE datastore_ro NOSUPERUSER NOCREATEDB NOCREATEROLE LOGIN PASSWORD '$DS_RO_PASS'; + CREATE ROLE datastore_ro NOSUPERUSER NOCREATEDB NOCREATEROLE LOGIN PASSWORD '$DATASTORE_READONLY_PASSWORD'; CREATE DATABASE datastore OWNER ckan ENCODING 'utf-8'; GRANT ALL PRIVILEGES ON DATABASE datastore TO ckan; EOSQL \ No newline at end of file diff --git a/compose/2.10/postgresql/docker-entrypoint-initdb.d/20_postgis_permissions.sql b/compose/postgresql/docker-entrypoint-initdb.d/20_postgis_permissions.sql similarity index 100% rename from compose/2.10/postgresql/docker-entrypoint-initdb.d/20_postgis_permissions.sql rename to compose/postgresql/docker-entrypoint-initdb.d/20_postgis_permissions.sql diff --git a/compose/solr/Dockerfile b/compose/solr/Dockerfile new file mode 100644 index 0000000..a42ae8a --- /dev/null +++ b/compose/solr/Dockerfile @@ -0,0 +1,23 @@ +ARG SOLR_VERSION + +FROM solr:${SOLR_VERSION:-9} + +EXPOSE 8983 + +ARG CKAN_BRANCH + +ENV SOLR_CONFIG_DIR="/opt/solr/server/solr/configsets" +ENV SOLR_SCHEMA_FILE="$SOLR_CONFIG_DIR/ckan/conf/managed-schema" + +USER root + +# Create a CKAN configset by copying the default one +RUN cp -R $SOLR_CONFIG_DIR/_default $SOLR_CONFIG_DIR/ckan + +# Update the schema +ADD https://raw.githubusercontent.com/ckan/ckan/$CKAN_BRANCH/ckan/config/solr/schema.xml $SOLR_SCHEMA_FILE +RUN chmod 644 $SOLR_SCHEMA_FILE + +USER solr + +CMD ["sh", "-c", "solr-precreate ckan $SOLR_CONFIG_DIR/ckan"] \ No newline at end of file diff --git a/images/ckan/2.10/Dockerfile b/images/ckan/2.10/Dockerfile index 484ce62..bd18b04 100644 --- a/images/ckan/2.10/Dockerfile +++ b/images/ckan/2.10/Dockerfile @@ -4,11 +4,11 @@ FROM alpine:3.17.2 AS ckanbuild # Used by Github Actions to tag the image with -ENV IMAGE_TAG=2.10.5 +ENV IMAGE_TAG=2.10.6 # Set CKAN version to build ENV GIT_URL=https://github.com/ckan/ckan.git -ENV GIT_BRANCH=ckan-2.10.5 +ENV GIT_BRANCH=ckan-2.10.6 # Set src dirs ENV SRC_DIR=/srv/app/src diff --git a/images/ckan/2.10/Dockerfile.focal b/images/ckan/2.10/Dockerfile.focal index 5d618ee..a293a9a 100644 --- a/images/ckan/2.10/Dockerfile.focal +++ b/images/ckan/2.10/Dockerfile.focal @@ -4,11 +4,11 @@ FROM ubuntu:focal-20210827 AS ckanbuild # Used by Github Actions to tag the image with -ENV IMAGE_TAG=2.10.5-focal +ENV IMAGE_TAG=2.10.6-focal # Set CKAN version to build ENV GIT_URL=https://github.com/ckan/ckan.git -ENV GIT_BRANCH=ckan-2.10.5 +ENV GIT_BRANCH=ckan-2.10.6 # Set timezone ENV TZ=UTC diff --git a/images/ckan/2.10/Dockerfile.xloader b/images/ckan/2.10/Dockerfile.xloader index 3c9f1ee..1651387 100644 --- a/images/ckan/2.10/Dockerfile.xloader +++ b/images/ckan/2.10/Dockerfile.xloader @@ -4,11 +4,11 @@ FROM alpine:3.17.2 as ckanbuild # Used by Github Actions to tag the image with -ENV IMAGE_TAG=2.10.5-xloader +ENV IMAGE_TAG=2.10.6-xloader # Set CKAN version to build ENV GIT_URL=https://github.com/ckan/ckan.git -ENV GIT_BRANCH=ckan-2.10.5 +ENV GIT_BRANCH=ckan-2.10.6 # Set src dirs ENV SRC_DIR=/srv/app/src diff --git a/images/ckan/2.11/Dockerfile b/images/ckan/2.11/Dockerfile index 0b0142c..012a0ac 100644 --- a/images/ckan/2.11/Dockerfile +++ b/images/ckan/2.11/Dockerfile @@ -4,11 +4,11 @@ FROM alpine:3.17.2 AS ckanbuild # Used by Github Actions to tag the image with -ENV IMAGE_TAG=2.11.0 +ENV IMAGE_TAG=2.11.1 # Set CKAN version to build ENV GIT_URL=https://github.com/ckan/ckan.git -ENV GIT_BRANCH=ckan-2.11.0 +ENV GIT_BRANCH=ckan-2.11.1 # Set src dirs ENV SRC_DIR=/srv/app/src diff --git a/images/ckan/2.11/Dockerfile.focal b/images/ckan/2.11/Dockerfile.focal index fdd3cca..7db3800 100644 --- a/images/ckan/2.11/Dockerfile.focal +++ b/images/ckan/2.11/Dockerfile.focal @@ -4,11 +4,11 @@ FROM ubuntu:focal-20240530 as ckanbuild # Used by Github Actions to tag the image with -ENV IMAGE_TAG=2.11.0-focal +ENV IMAGE_TAG=2.11.1-focal # Set CKAN version to build ENV GIT_URL=https://github.com/ckan/ckan.git -ENV GIT_BRANCH=ckan-2.11.0 +ENV GIT_BRANCH=ckan-2.11.1 # Set timezone ENV TZ=UTC diff --git a/images/ckan/2.11/Dockerfile.xloader b/images/ckan/2.11/Dockerfile.xloader index 07e18d4..f751a5d 100644 --- a/images/ckan/2.11/Dockerfile.xloader +++ b/images/ckan/2.11/Dockerfile.xloader @@ -4,11 +4,11 @@ FROM alpine:3.17.2 AS ckanbuild # Used by Github Actions to tag the image with -ENV IMAGE_TAG=2.11.0-xloader +ENV IMAGE_TAG=2.11.1-xloader # Set CKAN version to build ENV GIT_URL=https://github.com/ckan/ckan.git -ENV GIT_BRANCH=ckan-2.11.0 +ENV GIT_BRANCH=ckan-2.11.1 # Set src dirs ENV SRC_DIR=/srv/app/src