docker-ckan/ckan/Dockerfile.dev

84 lines
3.5 KiB
Docker

FROM ghcr.io/mjanez/ckan-base-spatial:ckan-2.9.11-dev
LABEL maintainer="mnl.janez@gmail.com"
# Set up environment variables
ENV APP_DIR=/srv/app \
TZ=UTC \
SRC_EXTENSIONS_DIR=/srv/app/src_extensions
# Set working directory
WORKDIR ${APP_DIR}
RUN echo ${TZ} > /etc/timezone && \
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/*
# 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:
# * Adding them to the .env file (check the ckanext-envvars syntax for env vars), or
# * Adding extra configuration scripts to /docker-entrypoint.d folder) to update
# the CKAN config file (ckan.ini) with the `ckan config-tool` command
#
# See README > Extending the base images for more details
#
# For instance:
#
###TODO: XLoader ###
# 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]
###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
# ###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=''"
# Clone the extension(s) your are writing for your own project in the `src` folder
# to get them mounted in this image at runtime
# Used to configure the container environment by setting environment variables, creating users, running initialization scripts, .etc
COPY docker-entrypoint.d/* /docker-entrypoint.d/
# Update who.ini with PROXY_CKAN_LOCATION
COPY setup/who.ini ./
# Override start_ckan.sh with DEV sh
COPY setup/start_ckan_development.sh.override ./start_ckan_development.sh
RUN chmod +x ./start_ckan_development.sh
## Load workers supervisor configuration
COPY setup/workers/* /etc/supervisord.d/
# Apply any patches needed to CKAN core or any of the built extensions (not the
# runtime mounted ones)
COPY patches patches
RUN for d in $APP_DIR/patches/*; do \
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