Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/official ckan 2.9.9 #44

Closed
wants to merge 7 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 46 additions & 28 deletions sddi-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# Build stage
###############################################################################
ARG CKAN_VERSION_BUILD_STAGE=2.9.9-dev
ARG CKAN_VERSION_BUILD_SPATIAL=2.9.9-focal
ARG CKAN_VERSION_RUNTIME_STAGE=2.9.9-focal
ARG CKAN_VERSION_BUILD_SPATIAL=2.9.9-dev
ARG CKAN_VERSION_RUNTIME_STAGE=2.9.9

FROM ckan/ckan-base:${CKAN_VERSION_BUILD_STAGE} as extbuild

Expand Down Expand Up @@ -101,38 +101,47 @@ RUN set -ex && \
git+${CKANEXT_PASSWORD_POLICY_GITHUB_URL}.git@${CKANEXT_PASSWORD_POLICY_VERSION}#egg=ckanext-password-policy

# ckanext-spatial #############################################################
FROM ghcr.io/keitaroinc/ckan:${CKAN_VERSION_BUILD_SPATIAL} as extbuild-spatial
FROM ckan/ckan-base:${CKAN_VERSION_BUILD_SPATIAL} as extbuild-spatial

ARG CKANEXT_SPATIAL_VERSION="c2118b9"
ARG CKANEXT_SPATIAL_VERSION="v2.1.1"
ENV CKANEXT_SPATIAL_VERSION=${CKANEXT_SPATIAL_VERSION}

USER root

# Install any system packages necessary to build extensions
RUN set -ex && \
apt-get update && \
apt-get install -y --no-install-recommends \
python3-dev python3-pip libxml2-dev libxslt1-dev libgeos-c1v5 python-is-python3 && \
mkdir -p /wheels && \
pip install -U pip
apk update && \
apk add --no-cache \
geos \
geos-dev \
proj-util \
proj-dev \
libxml2 \
libxslt \
gcc \
libxml2-dev \
libxslt-dev

RUN set -ex && \
pip install -r https://raw.githubusercontent.com/MarijaKnezevic/ckanext-spatial/${CKANEXT_SPATIAL_VERSION}/requirements.txt && \
mkdir -p /wheels && \
pip install --upgrade pip && \
pip install -r https://raw.githubusercontent.com/ckan/ckanext-spatial/${CKANEXT_SPATIAL_VERSION}/requirements.txt && \
curl -o /wheels/ckanext-spatial.txt \
https://raw.githubusercontent.com/MarijaKnezevic/ckanext-spatial/${CKANEXT_SPATIAL_VERSION}/requirements.txt && \
pip install -r https://raw.githubusercontent.com/MarijaKnezevic/ckanext-spatial/${CKANEXT_SPATIAL_VERSION}/requirements-postgis.txt && \
curl -o /wheels/ckanext-spatial-postgis.txt \
https://raw.githubusercontent.com/MarijaKnezevic/ckanext-spatial/${CKANEXT_SPATIAL_VERSION}/requirements-postgis.txt && \
ls -lah /wheels
https://raw.githubusercontent.com/ckan/ckanext-spatial/${CKANEXT_SPATIAL_VERSION}/requirements.txt

# pip install -r https://raw.githubusercontent.com/ckan/ckanext-spatial/${CKANEXT_SPATIAL_VERSION}/requirements-postgis.txt && \
# curl -o /wheels/ckanext-spatial-postgis.txt \
# https://raw.githubusercontent.com/ckan/ckanext-spatial/${CKANEXT_SPATIAL_VERSION}/requirements-postgis.txt && \
# ls -lah /wheels

RUN set -ex && \
pip wheel --wheel-dir=/wheels \
git+https://github.com/MarijaKnezevic/ckanext-spatial.git@${CKANEXT_SPATIAL_VERSION}#egg=ckanext-spatial
git+https://github.com/ckan/ckanext-spatial.git@${CKANEXT_SPATIAL_VERSION}#egg=ckanext-spatial

###############################################################################
# Runtime stage
###############################################################################
FROM ghcr.io/keitaroinc/ckan:${CKAN_VERSION_RUNTIME_STAGE} as runtime
FROM ckan/ckan-base:${CKAN_VERSION_RUNTIME_STAGE} as runtime

ENV CKAN__PLUGINS "image_view text_view recline_view webpage_view datastore datapusher \
hierarchy_display hierarchy_form display_group relation \
Expand All @@ -141,19 +150,25 @@ ENV CKAN__PLUGINS "image_view text_view recline_view webpage_view datastore data
envvars"

# Extra env for compatibility with ckan/base Docker images for downstream k8s
ENV CKAN_INI=${APP_DIR}/production.ini
ENV CKAN_INI=${APP_DIR}/ckan.ini
ENV CKAN_STORAGE_PATH=/var/lib/ckan
ENV TZ="UTC"

USER root

# Install any system packages necessary to build extensions
RUN set -ex && \
apt-get update && \
apt-get install -y --no-install-recommends \
libxml2-dev libxslt1-dev libgeos-c1v5 && \
pip install --no-cache-dir -U pip && \
rm -rf /var/lib/apt/lists/*
apk update && \
apk add --no-cache \
geos \
geos-dev \
proj-util \
proj-dev \
libxml2 \
libxslt \
gcc \
libxml2-dev \
libxslt-dev

# Copy python wheels from build stage
COPY --from=extbuild /wheels ${APP_DIR}/ext_wheels
Expand All @@ -177,8 +192,8 @@ RUN set -ex && \
# ckanext-spatial #############################################################
RUN set -ex && \
pip install -r ${APP_DIR}/ext_wheels/ckanext-spatial.txt && \
pip install -r ${APP_DIR}/ext_wheels/ckanext-spatial-postgis.txt && \
pip install --no-index --find-links=${APP_DIR}/ext_wheels ckanext-spatial
# pip install -r ${APP_DIR}/ext_wheels/ckanext-spatial-postgis.txt && \

# ckanext-scheming ############################################################
RUN set -ex && \
Expand All @@ -189,8 +204,8 @@ RUN set -ex && \
pip install --no-index --find-links=${APP_DIR}/ext_wheels ckanext-datesearch

# ckanext-composite ###########################################################
RUN set -ex && \
pip install --no-index --find-links=${APP_DIR}/ext_wheels ckanext-composite
# RUN set -ex && \
# pip install --no-index --find-links=${APP_DIR}/ext_wheels ckanext-composite

# ckanext-repeating ###########################################################
RUN set -ex && \
Expand All @@ -202,10 +217,13 @@ RUN set -ex && \
pip install --no-index --find-links=${APP_DIR}/ext_wheels ckanext-password-policy

# Copy init scripts and additional files
COPY --chown=ckan:ckan initScripts/ ${APP_DIR}/docker-afterinit.d
COPY --chown=ckan:ckan who.ini ${APP_DIR}/who.ini

# COPY --chown=ckan:ckan initScripts/ ${APP_DIR}/docker-afterinit.d
COPY --chown=ckan:ckan initScripts/ /docker-entrypoint.d/

RUN set -ex && \
pip install -U pip && \
pip install --upgrade Jinja2 && \
ckan config-tool "${CKAN_INI}" "ckan.plugins = ${CKAN__PLUGINS}" && \
ckan config-tool "${CKAN_INI}" "ckan.spatial.srid = 4326" && \
ckan config-tool "${CKAN_INI}" "ckanext.spatial.search_backend = solr-bbox" && \
Expand Down