2023-06-22 09:58:53 +02:00
|
|
|
FROM ghcr.io/mjanez/ckan-base-spatial:ckan-2.9.9-dev
|
2024-02-21 09:16:47 +01:00
|
|
|
LABEL maintainer="mnl.janez@gmail.com"
|
2022-07-13 18:36:14 +02:00
|
|
|
|
|
|
|
# Set up environment variables
|
2023-10-02 10:53:02 +02:00
|
|
|
ENV APP_DIR=/srv/app \
|
|
|
|
TZ=UTC \
|
|
|
|
SRC_EXTENSIONS_DIR=/srv/app/src_extensions
|
2022-07-13 18:36:14 +02:00
|
|
|
|
2024-02-21 09:16:47 +01:00
|
|
|
# Set working directory
|
|
|
|
WORKDIR ${APP_DIR}
|
2023-05-02 14:47:10 +02:00
|
|
|
RUN echo ${TZ} > /etc/timezone && \
|
2024-02-21 09:16:47 +01:00
|
|
|
if ! [ /usr/share/zoneinfo/${TZ} -ef /etc/localtime ]; then cp /usr/share/zoneinfo/${TZ} /etc/localtime; fi && \
|
|
|
|
apk --no-cache add sudo && \
|
|
|
|
# Remove apk cache
|
|
|
|
rm -rf /var/cache/apk/*
|
2022-07-13 18:36:14 +02:00
|
|
|
|
|
|
|
# Install any extensions needed by your CKAN instance
|
2022-07-19 14:23:54 +02:00
|
|
|
# - Make sure to add the plugins to CKAN__PLUGINS in the .env file
|
|
|
|
# - Also make sure all extra configuration options are added to the CKAN config file (ckan.ini)
|
|
|
|
# This can be done by creating an overriding start_ckan_dev_development.sh file:
|
|
|
|
# (https://github.com/ckan/ckan-docker-base/blob/main/ckan-2.9/dev/setup/start_ckan_development.sh) ie: updating the 'ckan config-tool' lines
|
2022-07-19 14:43:53 +02:00
|
|
|
# For more on config-tool please see https://docs.ckan.org/en/latest/maintaining/cli.html#config-tool-tool-for-editing-options-in-a-ckan-config-file
|
2022-07-19 14:23:54 +02:00
|
|
|
# or using Crudini (https://github.com/pixelb/crudini)
|
|
|
|
#
|
2022-07-13 18:36:14 +02:00
|
|
|
# For instance:
|
2022-07-19 14:23:54 +02:00
|
|
|
#
|
2023-03-17 11:09:20 +01:00
|
|
|
###TODO: XLoader ###
|
2023-03-23 13:54:14 +01:00
|
|
|
# RUN pip3 install -e 'git+https://github.com/ckan/ckanext-xloader.git@master#egg=ckanext-xloader' && \
|
|
|
|
# pip3 install -r ${APP_DIR}/src/ckanext-xloader/requirements.txt && \
|
|
|
|
# pip3 install -U requests[security]
|
2023-03-17 11:09:20 +01:00
|
|
|
|
2023-03-22 10:54:02 +01:00
|
|
|
###TODO: ckanext-visualize
|
|
|
|
#https://github.com/keitaroinc/ckanext-visualize
|
|
|
|
|
|
|
|
###TODO datapreview error
|
|
|
|
# 2023-03-19 12:54:42,311 WARNI [ckan.lib.datapreview] Plugin for view t could not be found
|
|
|
|
# 2023-03-19 12:54:42,313 WARNI [ckan.lib.datapreview] Plugin for view e could not be found
|
|
|
|
# 2023-03-19 12:54:42,314 WARNI [ckan.lib.datapreview] Plugin for view x could not be found
|
|
|
|
# 2023-03-19 12:54:42,315 WARNI [ckan.lib.datapreview] Plugin for view t could not be found
|
|
|
|
# https://github.com/ckan/ckan/search?q=datapreview&type=issues
|
|
|
|
|
2023-03-17 11:09:20 +01:00
|
|
|
# ###TODO: SPARQL Interface - Adapt to Py3###
|
|
|
|
# RUN echo "mjanez/sparql (Fixed version)" && \
|
|
|
|
# pip3 install -e git+https://github.com/mjanez/ckanext-sparql.git#egg=ckanext-sparql && \
|
|
|
|
# pip3 install -r ${APP_DIR}/src/ckanext-sparql/requirements.txt && \
|
|
|
|
# # update CKAN config with ckanext-sparql parameters
|
|
|
|
# ckan config-tool ${CKAN_INI} "ckanext.sparql.endpoint_url=''" && \
|
|
|
|
# ckan config-tool ${CKAN_INI} "ckanext.sparql.hide_endpoint_url=''"
|
2022-07-13 18:36:14 +02:00
|
|
|
|
|
|
|
# Clone the extension(s) your are writing for your own project in the `src` folder
|
|
|
|
# to get them mounted in this image at runtime
|
|
|
|
|
2023-03-17 11:09:20 +01:00
|
|
|
# Used to configure the container environment by setting environment variables, creating users, running initialization scripts, .etc
|
2023-10-02 10:53:02 +02:00
|
|
|
COPY docker-entrypoint.d/* /docker-entrypoint.d/
|
2023-03-17 11:09:20 +01:00
|
|
|
|
2023-07-26 10:25:03 +02:00
|
|
|
# Update who.ini with PROXY_CKAN_LOCATION
|
2024-02-21 09:16:47 +01:00
|
|
|
COPY setup/who.ini ./
|
2023-04-13 14:10:40 +02:00
|
|
|
|
2023-05-02 14:47:10 +02:00
|
|
|
# Override start_ckan.sh with DEV sh
|
2024-02-21 09:16:47 +01:00
|
|
|
COPY setup/start_ckan_development.sh.override ./start_ckan_development.sh
|
|
|
|
RUN chmod +x ./start_ckan_development.sh
|
|
|
|
|
|
|
|
## Harvester
|
|
|
|
COPY setup/workers/harvester.conf /etc/supervisord.d/harvester.conf
|
2023-05-02 14:47:10 +02:00
|
|
|
|
2023-09-28 13:36:09 +02:00
|
|
|
# Apply any patches needed to CKAN core or any of the built extensions (not the
|
2023-10-02 10:53:02 +02:00
|
|
|
# runtime mounted ones)
|
2024-02-21 09:16:47 +01:00
|
|
|
COPY patches patches
|
2022-07-13 18:36:14 +02:00
|
|
|
|
2023-08-09 10:56:49 +02:00
|
|
|
RUN for d in $APP_DIR/patches/*; do \
|
2024-02-21 09:16:47 +01:00
|
|
|
if [ -d $d ]; then \
|
|
|
|
for f in `ls $d/*.patch | sort -g`; do \
|
|
|
|
if [ -d $SRC_DIR/`basename "$d"` ]; then \
|
|
|
|
cd $SRC_DIR/`basename "$d"` && \
|
|
|
|
echo "$0: Applying patch $f to $SRC_DIR/`basename $d`" && \
|
|
|
|
patch -p1 < "$f" ; \
|
|
|
|
else \
|
|
|
|
echo "$0: Skipping patch $f because directory $SRC_DIR/`basename $d` does not exist. Built the extension: `basename $d`" ; \
|
|
|
|
fi \
|
|
|
|
done ; \
|
|
|
|
fi ; \
|
|
|
|
done
|