forked from ckan/ckan-docker
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore(deps): update dependencies and settings for CKAN 2.11 compatibility * Explicitly add linux/amd64 platform to docker as there are no other images * Clarify and clean up Dockerfile * Current status of 2.11.1 upgrade * Adjust dockerfile * Add license * Correct readme * fix permission issues * Revert x64 * Sonarcloud recomendations * Applied review comments * fix Civity reference to scheming --------- Co-authored-by: Mark Janse <[email protected]> Co-authored-by: Hans-Chrstian <[email protected]> Co-authored-by: kburger <[email protected]>
- Loading branch information
1 parent
24920cc
commit 4089575
Showing
18 changed files
with
228 additions
and
2,687 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,44 +3,52 @@ | |
# | ||
# SPDX-License-Identifier: AGPL-3.0-only | ||
|
||
# Host Ports | ||
CKAN_PORT_HOST=5500 | ||
|
||
# Postgres | ||
# CKAN databases | ||
POSTGRES_USER=postgres | ||
POSTGRES_PASSWORD=postgres | ||
POSTGRES_DB=postgres | ||
POSTGRES_HOST=postgres | ||
POSTGRES_HOST=db | ||
CKAN_DB_USER=ckandbuser | ||
CKAN_DB_PASSWORD=ckandbpassword | ||
CKAN_DB=ckandb | ||
CKAN_SQLALCHEMY_URL=postgresql://ckandbuser:ckandbpassword@db/ckandb | ||
|
||
# Dev settings | ||
USE_HTTPS_FOR_DEV=false | ||
|
||
# Host Ports | ||
CKAN_PORT_HOST=5500 | ||
|
||
# CKAN core | ||
CKAN_VERSION=2.10.5 | ||
CKAN_VERSION=2.11.1 | ||
CKAN_SITE_ID=default | ||
CKAN_SITE_URL=http://localhost:5500 | ||
CKAN__CORS__ORIGIN_WHITELIST=http://localhost:3000 | ||
|
||
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_SYSADMIN_NAME=ckan_admin | ||
CKAN_SYSADMIN_PASSWORD=test1234 | ||
CKAN_SYSADMIN_EMAIL=[email protected] | ||
CKAN_STORAGE_PATH=/var/lib/ckan | ||
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 | ||
CKAN_MAX_UPLOAD_SIZE_MB=10 | ||
CKAN_SQLALCHEMY_URL=postgresql://${CKAN_DB_USER}:${CKAN_DB_PASSWORD}@${POSTGRES_HOST}/${CKAN_DB} | ||
TEST_CKAN_SQLALCHEMY_URL=postgres://{CKAN_DB_USER}:${CKAN_DB_PASSWORD}@${POSTGRES_HOST}/ckan_test | ||
CKAN_SOLR_URL=http://solr:8983/solr/ckan | ||
TEST_CKAN_SOLR_URL=http://solr:8983/solr/ckan | ||
TZ=Europe/Amsterdam | ||
|
||
# Redis | ||
REDIS_VERSION=7.4.2 | ||
CKAN_REDIS_URL=redis://redis:6379/1 | ||
TEST_CKAN_REDIS_URL=redis://redis:6379/1 | ||
|
||
CKAN__HARVEST__MQ__TYPE=redis | ||
# Solr | ||
CKAN_SOLR_URL=http://solr:8983/solr/ckan | ||
|
||
# Extensions | ||
CKAN__PLUGINS="envvars scheming_datasets scheming_organizations gdi_userportal dcat harvest dcat_rdf_harvester fairdatapointharvester activity" | ||
CKAN__HARVEST__MQ__HOSTNAME=redis | ||
CKAN__HARVEST__MQ__PORT=6379 | ||
CKAN__HARVEST__MQ__REDIS_DB=1 | ||
|
@@ -52,3 +60,5 @@ CKAN___LOGGER_CKANEXT__LEVEL=DEBUG | |
|
||
#OTEL | ||
OTEL_SDK_DISABLED=true | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
# SPDX-FileCopyrightText: 2006-2024 Open Knowledge Foundation and contributors | ||
# | ||
# SPDX-License-Identifier: AGPL-3.0-only | ||
|
||
set -e | ||
ROOT="$(dirname ${BASH_SOURCE[0]})/.." | ||
|
||
docker compose -f "${ROOT}/docker-compose.dev.yml" exec ckan-dev ckan "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
# SPDX-FileCopyrightText: 2006-2024 Open Knowledge Foundation and contributors | ||
# | ||
# SPDX-License-Identifier: AGPL-3.0-only | ||
|
||
set -e | ||
ROOT="$(dirname ${BASH_SOURCE[0]})/.." | ||
|
||
docker compose -f "${ROOT}/docker-compose.yml" "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
# SPDX-FileCopyrightText: 2006-2024 Open Knowledge Foundation and contributors | ||
# | ||
# SPDX-License-Identifier: AGPL-3.0-only | ||
|
||
set -e | ||
ROOT="$(dirname ${BASH_SOURCE[0]})/.." | ||
|
||
docker compose -f "${ROOT}/docker-compose.yml" run -u root ckan-dev ./install_src.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,56 +4,57 @@ | |
# | ||
# SPDX-License-Identifier: AGPL-3.0-only | ||
|
||
FROM docker.io/ckan/ckan-base:2.10.6 | ||
FROM ckan/ckan-base:2.11.1 | ||
|
||
RUN pip3 install -e git+https://github.com/GenomicDataInfrastructure/[email protected]#egg=ckanext-gdi-userportal && \ | ||
USER root | ||
RUN chown -R ckan:ckan-sys ${APP_DIR} | ||
USER ckan | ||
|
||
RUN pip3 install -e git+https://github.com/GenomicDataInfrastructure/[email protected]#egg=ckanext-gdi-userportal && \ | ||
pip3 install -r ${APP_DIR}/src/ckanext-gdi-userportal/requirements.txt | ||
|
||
RUN pip3 install -e git+https://github.com/ckan/[email protected]#egg=ckanext-dcat && \ | ||
RUN pip3 install -e git+https://github.com/ckan/[email protected]#egg=ckanext-dcat && \ | ||
pip3 install -r ${APP_DIR}/src/ckanext-dcat/requirements.txt | ||
|
||
RUN pip3 install -e git+https://github.com/ckan/[email protected]#egg=ckanext-harvest && \ | ||
pip3 install -r ${APP_DIR}/src/ckanext-harvest/requirements.txt | ||
|
||
RUN pip3 install -e git+https://github.com/CivityNL/[email protected]#egg=ckanext-scheming[requirements] | ||
RUN pip3 install -e git+https://github.com/CivityNL/[email protected]-1#egg=ckanext-scheming[requirements] | ||
|
||
RUN pip3 install -e git+https://github.com/GenomicDataInfrastructure/[email protected]#egg=ckanext-fairdatapoint && \ | ||
RUN pip3 install -e git+https://github.com/GenomicDataInfrastructure/[email protected]#egg=ckanext-fairdatapoint && \ | ||
pip3 install -r ${APP_DIR}/src/ckanext-fairdatapoint/requirements.txt | ||
|
||
# Create log directories for CKAN harvester | ||
RUN mkdir -p /var/log/ckan/std && chown -R ckan:ckan /var/log/ckan | ||
USER root | ||
|
||
# Copy custom initialization scripts | ||
COPY docker-entrypoint.d/* /docker-entrypoint.d/ | ||
### Install everything we need for the harvester | ||
# Install cron and supervisor | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
cron \ | ||
supervisor \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& mkdir -p /var/log/ckan/std /var/log/supervisor /etc/supervisor/conf.d \ | ||
&& chown -R ckan:ckan-sys /var/log/ckan /var/log/supervisor /etc/supervisor/conf.d | ||
|
||
# Config cron job for harvesting | ||
COPY config/supervisord.conf /etc/supervisord.d/ckan.conf | ||
COPY config/crontab ${APP_DIR}/crontab | ||
RUN crontab ${APP_DIR}/crontab | ||
|
||
# Apply any patches needed to CKAN core or any of the built extensions (not the | ||
# runtime mounted ones) | ||
COPY patches ${APP_DIR}/patches | ||
COPY config/crontab /etc/cron.d/ckan-cron | ||
|
||
RUN for d in $APP_DIR/patches/*; do \ | ||
if [ -d $d ]; then \ | ||
for f in `ls $d/*.patch | sort -g`; do \ | ||
cd $SRC_DIR/`basename "$d"` && echo "$0: Applying patch $f to $SRC_DIR/`basename $d`"; patch -p1 < "$f" ; \ | ||
done ; \ | ||
fi ; \ | ||
done | ||
# Running cron as non-root user and give permission to ckan user | ||
RUN chmod gu+rw /var/run && \ | ||
chmod gu+s /usr/sbin/cron && \ | ||
crontab -u ckan /etc/cron.d/ckan-cron | ||
|
||
ENV CKAN__PLUGINS="image_view text_view datatables_view envvars scheming_datasets scheming_organizations dcat dcat_json_interface harvest ckan_harvester dcat_rdf_harvester dcat_json_harvester fairdatapointharvester gdi_userportal activity" | ||
COPY --chown=ckan-sys:ckan-sys docker-entrypoint.d/* /docker-entrypoint.d/ | ||
COPY --chown=ckan-sys:ckan-sys patches ${APP_DIR}/patches | ||
COPY --chown=ckan-sys:ckan-sys setup/prerun.py ${APP_DIR} | ||
COPY --chown=ckan-sys:ckan-sys setup/start_ckan_development.sh ${APP_DIR} | ||
|
||
COPY --chown=ckan:ckan setup/prerun.py ${APP_DIR} | ||
USER ckan | ||
|
||
# TODO | ||
# 1. Remove this command once the issue is fixed | ||
# https://github.com/ckan/ckan-docker-base/issues/41 | ||
RUN mkdir -p /var/lib/ckan/storage/uploads/group && \ | ||
mkdir -p /var/lib/ckan/storage/uploads/user && \ | ||
chmod -R u+rwx "/var/lib/ckan" | ||
|
||
# https://github.com/ckan/ckan-docker-base/issues/82 | ||
# CVE-2024-32002 was found on git and related packages | ||
RUN apk del git git-perl perl-git | ||
RUN for d in $APP_DIR/patches/*; do \ | ||
if [ -d $d ]; then \ | ||
for f in `ls $d/*.patch | sort -g`; do \ | ||
cd $SRC_DIR/`basename "$d"` && echo "$0: Applying patch $f to $SRC_DIR/`basename $d`"; patch -p1 < "$f" ; \ | ||
done ; \ | ||
fi ; \ | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,51 +4,59 @@ | |
# | ||
# SPDX-License-Identifier: AGPL-3.0-only | ||
|
||
FROM docker.io/ckan/ckan-dev:2.10.6 | ||
FROM ckan/ckan-dev:2.11.1 | ||
|
||
RUN pip3 install -e git+https://github.com/ckan/[email protected]#egg=ckanext-dcat && \ | ||
USER root | ||
RUN chown -R ckan:ckan-sys ${APP_DIR} | ||
USER ckan | ||
|
||
|
||
RUN pip3 install -e git+https://github.com/ckan/[email protected]#egg=ckanext-dcat && \ | ||
pip3 install -r ${APP_DIR}/src/ckanext-dcat/requirements.txt | ||
|
||
RUN pip3 install -e git+https://github.com/ckan/[email protected]#egg=ckanext-harvest && \ | ||
pip3 install -r ${APP_DIR}/src/ckanext-harvest/requirements.txt | ||
|
||
RUN pip3 install -e git+https://github.com/CivityNL/[email protected]#egg=ckanext-scheming[requirements] | ||
RUN pip3 install -e git+https://github.com/CivityNL/[email protected]-1#egg=ckanext-scheming[requirements] | ||
|
||
RUN pip3 install -e git+https://github.com/GenomicDataInfrastructure/[email protected]#egg=ckanext-fairdatapoint && \ | ||
RUN pip3 install -e git+https://github.com/GenomicDataInfrastructure/[email protected]#egg=ckanext-fairdatapoint && \ | ||
pip3 install -r ${APP_DIR}/src/ckanext-fairdatapoint/requirements.txt | ||
|
||
# Create log directories for CKAN harvester | ||
RUN mkdir -p /var/log/ckan/std && chown -R ckan:ckan /var/log/ckan | ||
USER root | ||
|
||
# Copy custom initialization scripts | ||
COPY docker-entrypoint.d/* /docker-entrypoint.d/ | ||
### Install everything we need for the harvester | ||
# Install cron and supervisor | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
cron \ | ||
supervisor \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& mkdir -p /var/log/ckan/std /var/log/supervisor /etc/supervisor/conf.d \ | ||
&& chown -R ckan:ckan-sys /var/log/ckan /var/log/supervisor /etc/supervisor/conf.d | ||
|
||
# Config cron job for harvesting | ||
COPY config/supervisord.conf /etc/supervisord.d/ckan.conf | ||
COPY config/crontab ${APP_DIR}/crontab | ||
RUN crontab ${APP_DIR}/crontab | ||
COPY config/crontab /etc/cron.d/ckan-cron | ||
|
||
# Apply any patches needed to CKAN core or any of the built extensions (not the | ||
# runtime mounted ones) | ||
COPY patches ${APP_DIR}/patches | ||
# Running cron as non-root user and give permission to ckan user | ||
RUN chmod gu+rw /var/run && \ | ||
chmod gu+s /usr/sbin/cron && \ | ||
crontab -u ckan /etc/cron.d/ckan-cron | ||
|
||
RUN for d in $APP_DIR/patches/*; do \ | ||
if [ -d $d ]; then \ | ||
for f in `ls $d/*.patch | sort -g`; do \ | ||
cd $SRC_DIR/`basename "$d"` && echo "$0: Applying patch $f to $SRC_DIR/`basename $d`"; patch -p1 < "$f" ; \ | ||
done ; \ | ||
fi ; \ | ||
done | ||
COPY --chown=ckan-sys:ckan-sys docker-entrypoint.d/* /docker-entrypoint.d/ | ||
COPY --chown=ckan-sys:ckan-sys patches ${APP_DIR}/patches | ||
COPY --chown=ckan-sys:ckan-sys setup/prerun.py ${APP_DIR} | ||
COPY --chown=ckan-sys:ckan-sys setup/start_ckan_development.sh ${APP_DIR} | ||
|
||
ENV CKAN__PLUGINS="image_view text_view datatables_view envvars scheming_datasets scheming_organizations gdi_userportal dcat harvest ckan_harvester dcat_rdf_harvester dcat_json_harvester dcat_json_interface fairdatapointharvester activity" | ||
USER ckan | ||
|
||
COPY --chown=ckan:ckan setup/prerun.py ${APP_DIR} | ||
COPY --chown=ckan:ckan setup/start_ckan_development.sh ${APP_DIR} | ||
RUN for d in $APP_DIR/patches/*; do \ | ||
if [ -d $d ]; then \ | ||
for f in `ls $d/*.patch | sort -g`; do \ | ||
cd $SRC_DIR/`basename "$d"` && echo "$0: Applying patch $f to $SRC_DIR/`basename $d`"; patch -p1 < "$f" ; \ | ||
done ; \ | ||
fi ; \ | ||
done | ||
|
||
RUN mkdir -p /var/lib/ckan/storage/uploads/group && \ | ||
mkdir -p /var/usr/ckan/storage/uploads/user && \ | ||
chmod -R u+rwx "/var/lib/ckan" | ||
|
||
# https://github.com/ckan/ckan-docker-base/issues/82 | ||
# CVE-2024-32002 was found on git and related packages | ||
RUN apk del git git-perl perl-git | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.