2023-02-15 15:51:23 +01:00
|
|
|
FROM ckan/ckan-base:ckan-2.10.0-dev
|
2022-07-13 18:36:14 +02:00
|
|
|
|
|
|
|
# Set up environment variables
|
|
|
|
ENV APP_DIR=/srv/app
|
|
|
|
ENV TZ=UTC
|
|
|
|
RUN echo ${TZ} > /etc/timezone
|
|
|
|
|
2023-03-17 11:09:20 +01:00
|
|
|
# Set up PROJ
|
|
|
|
# PROJ4 for ckanext-spatial: https://github.com/pyproj4/pyproj/issues/582 // https://github.com/nickumia-reisys/ckanext-geodatagov/commit/ed61ffdd118e21e7a1db482c75738c3f261aa180
|
|
|
|
RUN apk add geos-dev proj proj-util proj-dev
|
|
|
|
|
2022-07-13 18:36:14 +02:00
|
|
|
# Make sure both files are not exactly the same
|
|
|
|
RUN if ! [ /usr/share/zoneinfo/${TZ} -ef /etc/localtime ]; then \
|
|
|
|
cp /usr/share/zoneinfo/${TZ} /etc/localtime ;\
|
|
|
|
fi ;
|
|
|
|
|
|
|
|
# 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
|
|
|
#
|
|
|
|
### 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]
|
|
|
|
|
2023-03-17 11:09:20 +01:00
|
|
|
|
|
|
|
###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]
|
|
|
|
|
2022-07-19 14:23:54 +02:00
|
|
|
### Harvester ###
|
2023-03-17 11:09:20 +01:00
|
|
|
RUN echo "ckan/ckanext-harvester" && \
|
|
|
|
pip3 install -e 'git+https://github.com/ckan/ckanext-harvest.git@master#egg=ckanext-harvest' && \
|
2023-03-02 17:36:19 +01:00
|
|
|
pip3 install -r ${APP_DIR}/src/ckanext-harvest/pip-requirements.txt
|
2022-07-19 14:23:54 +02:00
|
|
|
# will also require gather_consumer and fetch_consumer processes running (please see https://github.com/ckan/ckanext-harvest)
|
|
|
|
|
2023-03-17 11:09:20 +01:00
|
|
|
### Resource dictionary-Fix version ###
|
|
|
|
RUN echo "mjanez/ckanext-resourcedictionary" && \
|
|
|
|
pip3 install -e git+https://github.com/mjanez/ckanext-resourcedictionary.git#egg=ckanext-resourcedictionary && \
|
2023-03-02 17:36:19 +01:00
|
|
|
pip3 install -r ${APP_DIR}/src/ckanext-resourcedictionary/requirements.txt
|
|
|
|
|
|
|
|
### Geoview ###
|
2023-03-17 11:09:20 +01:00
|
|
|
RUN echo "ckan/ckanext-geoview" && \
|
|
|
|
pip3 install -e git+https://github.com/ckan/ckanext-geoview.git#egg=ckanext-geoview
|
|
|
|
|
|
|
|
### Spatial ### Check solr geoindexing: https://docs.ckan.org/projects/ckanext-spatial/en/latest/spatial-search.html // https://github.com/ckan/ckanext-spatial/issues/195
|
|
|
|
#TODO: 2.10 support reqs: https://github.com/ckan/ckanext-spatial/pull/308
|
|
|
|
RUN echo "ckan/ckanext-spatial" && \
|
|
|
|
pip3 install -e git+https://github.com/ckan/ckanext-spatial.git#egg=ckanext-spatial && \
|
|
|
|
pip3 install -r https://raw.githubusercontent.com/ckan/ckanext-spatial/bae9290395b252ee8e40056256fa694569d1d78b/requirements.txt
|
|
|
|
|
|
|
|
### Scheming-GeoDCAT-AP extended version ###
|
|
|
|
RUN echo "mjanez/ckanext-scheming (GeoDCAT-AP extended version)" && \
|
|
|
|
pip3 install -e git+https://github.com/mjanez/ckanext-scheming.git#egg=ckanext-scheming && \
|
|
|
|
# update CKAN config with ckanext-scheming parameters
|
|
|
|
ckan config-tool ${CKAN_INI} "scheming.dataset_schemas=''" && \
|
|
|
|
ckan config-tool ${CKAN_INI} "scheming.group_schemas=''" && \
|
|
|
|
ckan config-tool ${CKAN_INI} "scheming.organization_schemas=''" && \
|
|
|
|
ckan config-tool ${CKAN_INI} "scheming.presets=''"
|
2022-07-19 14:23:54 +02:00
|
|
|
|
|
|
|
### Pages ###
|
2023-03-17 11:09:20 +01:00
|
|
|
RUN echo "ckan/ckanext-pages" && \
|
|
|
|
pip3 install -e git+https://github.com/ckan/ckanext-pages.git#egg=ckanext-pages
|
2023-03-02 17:36:19 +01:00
|
|
|
|
|
|
|
### PDFView ###
|
2023-03-17 11:09:20 +01:00
|
|
|
RUN echo "ckan/ckanext-pdfview" && \
|
|
|
|
pip3 install -e git+https://github.com/ckan/ckanext-pdfview.git#egg=ckanext-pdfview
|
|
|
|
|
|
|
|
### DCAT-GeoDCAT-AP extended version ###
|
|
|
|
RUN echo "mjanez/ckanext-dcat (GeoDCAT-AP extended version)" && \
|
|
|
|
pip3 install -e git+https://github.com/mjanez/ckanext-dcat.git#egg=ckanext-dcat && \
|
|
|
|
pip3 install -r https://raw.githubusercontent.com/mjanez/ckanext-dcat/master/requirements.txt
|
|
|
|
|
|
|
|
# ###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
|
|
|
|
COPY docker-entrypoint.d/* /docker-entrypoint.d/
|
|
|
|
|
2022-07-13 18:36:14 +02:00
|
|
|
# Apply any patches needed to CKAN core or any of the built extensions (not the
|
2022-07-19 16:09:55 +02:00
|
|
|
# runtime mounted ones)
|
2022-07-13 18:36:14 +02:00
|
|
|
COPY patches ${APP_DIR}/patches
|
|
|
|
|
|
|
|
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 ; \
|
2023-03-17 11:09:20 +01:00
|
|
|
done
|