Skip to content

Commit

Permalink
Merge pull request #3 from tum-gis/master
Browse files Browse the repository at this point in the history
Docker file for composite, repeating, geoview and userautoaddgroup
  • Loading branch information
BWibo authored Jan 24, 2023
2 parents 103e188 + 4df996a commit 1f07bc7
Show file tree
Hide file tree
Showing 5 changed files with 285 additions and 0 deletions.
60 changes: 60 additions & 0 deletions ckan-ext/ckanext-ckan-docker-composite/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
###################
### Extensions ####
###################
ARG CKAN_VERSION=2.9.5
FROM ghcr.io/keitaroinc/ckan:${CKAN_VERSION} as extbuild

ARG CKAN_EXT_COMPOSITE_VERSION=master
ENV CKAN_EXT_COMPOSITE_VERSION=${CKAN_EXT_COMPOSITE_VERSION}

# Switch to the root user
USER root

# Install any system packages necessary to build extensions
RUN pip install -r https://raw.githubusercontent.com/EnviDat/ckanext-composite/${CKAN_EXT_COMPOSITE_VERSION}/dev-requirements.txt

RUN set -ex && \
pip wheel --wheel-dir=/wheels git+https://github.com/EnviDat/ckanext-composite.git@${CKAN_EXT_COMPOSITE_VERSION}#egg=ckanext-composite


############
### MAIN ###
############
ARG CKAN_VERSION=2.9.5
FROM ghcr.io/keitaroinc/ckan:${CKAN_VERSION} as runtime

# Install and enable the custom extensions
RUN set -ex && \
# Upgrade pip
# pip install --no-cache-dir -U pip && \
# Install additional pip packages for runtime
pip install --no-cache-dir -U ckanapi
# Install ckan extension wheels from build stage
# pip install --no-index --find-links=/srv/app/ext_wheels ckanext-hierarchy ckanext-grouphierarchy ckanext-scheming && \
# chown -R ckan:ckan /srv/app && \
# rm -rf /srv/app/ext_wheels && \
# ckan -c ${APP_DIR}/production.ini config-tool "ckan.plugins = ${CKAN__PLUGINS}" && \

# Setup SDDI CKAN styling
COPY --chown=ckan:ckan afterinit.d/02_create_groups.sh ${APP_DIR}/docker-afterinit.d/
COPY --chown=ckan:ckan webassets/ ${DATA_DIR}/webassets/

# List all extensions here
ENV CKAN__PLUGINS envvars image_view text_view recline_view datastore datapusher composite

# Switch to the root user
USER root

# Copy python wheels from build stage
COPY --from=extbuild /wheels /srv/app/ext_wheels

# Install and enable the custom extensions, remove wheels
RUN set -ex && \
pip install --no-index --find-links=/srv/app/ext_wheels ckanext-composite && \
# pip install --no-index --find-links=/srv/app/ext_wheels -r /srv/app/ext_wheels/ckanext-composite .txt && \
ckan config-tool "${APP_DIR}/production.ini" "ckan.plugins = ${CKAN__PLUGINS}" && \
chown -R ckan:ckan /srv/app && \
rm -rf /srv/app/ext_wheels

# Switch to the ckan user
USER ckan
61 changes: 61 additions & 0 deletions ckan-ext/ckanext-ckan-docker-datesearch/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
###################
### Extensions ####
###################
ARG CKAN_VERSION=2.9.5
FROM ghcr.io/keitaroinc/ckan:${CKAN_VERSION} as extbuild

ARG CKAN_EXT_DATESEARCH_VERSION=master
ENV CKAN_EXT_DATESEARCH_VERSION=${CKAN_EXT_DATESEARCH_VERSION}

# Switch to the root user
USER root

# Install any system packages necessary to build extensions


RUN set -ex && \
mkdir -p /wheels && \
pip wheel --wheel-dir=/wheels git+https://github.com/MarijaKnezevic/ckanext-datesearch.git@${CKAN_EXT_DATESEARCH_VERSION}#egg=ckanext-datesearch && \
ls -lah /wheels

############
### MAIN ###
############
ARG CKAN_VERSION=2.9.5
FROM ghcr.io/keitaroinc/ckan:${CKAN_VERSION} as runtime

# Install and enable the custom extensions
RUN set -ex && \
# Upgrade pip
# pip install --no-cache-dir -U pip && \
# Install additional pip packages for runtime
pip install --no-cache-dir -U ckanapi
# Install ckan extension wheels from build stage
# pip install --no-index --find-links=/srv/app/ext_wheels ckanext-hierarchy ckanext-grouphierarchy ckanext-scheming && \
# chown -R ckan:ckan /srv/app && \
# rm -rf /srv/app/ext_wheels && \
# ckan -c ${APP_DIR}/production.ini config-tool "ckan.plugins = ${CKAN__PLUGINS}" && \

# Setup SDDI CKAN styling
COPY --chown=ckan:ckan afterinit.d/02_create_groups.sh ${APP_DIR}/docker-afterinit.d/
COPY --chown=ckan:ckan webassets/ ${DATA_DIR}/webassets/

# List all extensions here
ENV CKAN__PLUGINS envvars image_view text_view recline_view datastore datapusher datesearch

# Switch to the root user
USER root

# Copy python wheels from build stage
COPY --from=extbuild /wheels /srv/app/ext_wheels

# Install and enable the custom extensions, remove wheels
RUN set -ex && \
pip install --no-index --find-links=/srv/app/ext_wheels ckanext-datesearch && \
# pip install --no-index --find-links=/srv/app/ext_wheels -r /srv/app/ext_wheels/ckanext-datesearch.txt && \
ckan config-tool "${APP_DIR}/production.ini" "ckan.plugins = ${CKAN__PLUGINS}" && \
chown -R ckan:ckan /srv/app && \
rm -rf /srv/app/ext_wheels

# Switch to the ckan user
USER ckan
59 changes: 59 additions & 0 deletions ckan-ext/ckanext-ckan-docker-repeating/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
###################
### Extensions ####
###################
ARG CKAN_VERSION=2.9.5
FROM ghcr.io/keitaroinc/ckan:${CKAN_VERSION} as extbuild

ARG CKAN_EXT_REPEATING_VERSION=master
ENV CKAN_EXT_REPEATING_VERSION=${CKAN_EXT_REPEATING_VERSION}

# Switch to the root user
USER root

# Install any system packages necessary to build extensions

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


############
### MAIN ###
############
ARG CKAN_VERSION=2.9.5
FROM ghcr.io/keitaroinc/ckan:${CKAN_VERSION} as runtime

# Install and enable the custom extensions
RUN set -ex && \
# Upgrade pip
# pip install --no-cache-dir -U pip && \
# Install additional pip packages for runtime
pip install --no-cache-dir -U ckanapi
# Install ckan extension wheels from build stage
# pip install --no-index --find-links=/srv/app/ext_wheels ckanext-hierarchy ckanext-grouphierarchy ckanext-scheming && \
# chown -R ckan:ckan /srv/app && \
# rm -rf /srv/app/ext_wheels && \
# ckan -c ${APP_DIR}/production.ini config-tool "ckan.plugins = ${CKAN__PLUGINS}" && \

# Setup SDDI CKAN styling
COPY --chown=ckan:ckan afterinit.d/02_create_groups.sh ${APP_DIR}/docker-afterinit.d/
COPY --chown=ckan:ckan webassets/ ${DATA_DIR}/webassets/

# List all extensions here
ENV CKAN__PLUGINS envvars image_view text_view recline_view datastore datapusher repeating

# Switch to the root user
USER root

# Copy python wheels from build stage
COPY --from=extbuild /wheels /srv/app/ext_wheels

# Install and enable the custom extensions, remove wheels
RUN set -ex && \
pip install --no-index --find-links=/srv/app/ext_wheels ckanext-repeating && \
# pip install --no-index --find-links=/srv/app/ext_wheels -r /srv/app/ext_wheels/ckanext-composite .txt && \
ckan config-tool "${APP_DIR}/production.ini" "ckan.plugins = ${CKAN__PLUGINS}" && \
chown -R ckan:ckan /srv/app && \
rm -rf /srv/app/ext_wheels

# Switch to the ckan user
USER ckan
47 changes: 47 additions & 0 deletions ckan-ext/ckanext-docker-geoview/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
###################
### Extensions ####
###################
ARG CKAN_VERSION=2.9.5
FROM ghcr.io/keitaroinc/ckan:${CKAN_VERSION} as extbuild

ARG CKAN_EXT_GEOVIEW_VERSION=master
ENV CKAN_EXT_GEOVIEW_VERSION=${CKAN_EXT_GEOVIEW_VERSION}

# Switch to the root user
USER root

# Install any system packages necessary to build extensions
RUN pip install -r https://raw.githubusercontent.com/ckan/ckanext-geoview/${CKAN_EXT_GEOVIEW_VERSION}/dev-requirements.txt

RUN pip wheel --wheel-dir=/wheels git+https://github.com/ckan/ckanext-geoview.git@${CKAN_EXT_GEOVIEW_VERSION}#egg=ckanext-geoview

############
### MAIN ###
############
ARG CKAN_VERSION=2.9.5
FROM ghcr.io/keitaroinc/ckan:${CKAN_VERSION} as runtime

# List all extensions here
ENV CKAN__PLUGINS envvars image_view text_view recline_view datastore datapusher resource_proxy geo_view geojson_view wmts_view shp_view


# Switch to the root user
USER root

# Copy python wheels from build stage
COPY --from=extbuild /wheels /srv/app/ext_wheels

# Install and enable the custom extensions, remove wheels
RUN set -ex && \
pip install --no-index --find-links=/srv/app/ext_wheels ckanext-geoview && \
# pip install --no-index --find-links=/srv/app/ext_wheels -r /srv/app/ext_wheels/ckanext-geoview.txt && \
ckan config-tool "${APP_DIR}/production.ini" "ckan.plugins = ${CKAN__PLUGINS}" && \
ckan config-tool "${APP_DIR}/production.ini" "ckan.views.default_views = geo_view geojson_view wmts_view shp_view" && \
ckan config-tool "${APP_DIR}/production.ini" "ckanext.geoview.ol_viewer.formats = wms kml" && \
ckan config-tool "${APP_DIR}/production.ini" "ckanext.geoview.shp_viewer.srid = 4326" && \
ckan config-tool "${APP_DIR}/production.ini" "ckanext.geoview.shp_viewer.encoding = UTF-8" && \
chown -R ckan:ckan /srv/app && \
rm -rf /srv/app/ext_wheels

# Switch to the ckan user
USER ckan
58 changes: 58 additions & 0 deletions ckan-ext/ckanext-docker-userautoaddgroup/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
###################
### Extensions ####
###################
ARG CKAN_VERSION=2.9.5
FROM ghcr.io/keitaroinc/ckan:${CKAN_VERSION} as extbuild

ARG CKAN_EXT_USRADDGROUP_VERSION=master
ENV CKAN_EXT_USRADDGROUP_VERSION=${CKAN_EXT_USRADDGROUP_VERSION}

# Switch to the root user
USER root

# Install any system packages necessary to build extensions
#

RUN pip wheel --wheel-dir=/wheels git+https://github.com/tum-gis/ckanext-userautoaddgroup-sddi.git@${CKAN_EXT_USRADDGROUP_VERSION}#egg=ckanext-userautoaddgroup


############
### MAIN ###
############
ARG CKAN_VERSION=2.9.5
FROM ghcr.io/keitaroinc/ckan:${CKAN_VERSION} as runtime

# Install and enable the custom extensions
RUN set -ex && \
# Upgrade pip
# pip install --no-cache-dir -U pip && \
# Install additional pip packages for runtime
pip install --no-cache-dir -U ckanapi
# Install ckan extension wheels from build stage
# pip install --no-index --find-links=/srv/app/ext_wheels ckanext-hierarchy ckanext-grouphierarchy ckanext-scheming && \
# chown -R ckan:ckan /srv/app && \
# rm -rf /srv/app/ext_wheels && \
# ckan -c ${APP_DIR}/production.ini config-tool "ckan.plugins = ${CKAN__PLUGINS}" && \

# Setup SDDI CKAN styling
COPY --chown=ckan:ckan afterinit.d/02_create_groups.sh ${APP_DIR}/docker-afterinit.d/
COPY --chown=ckan:ckan webassets/ ${DATA_DIR}/webassets/

# List all extensions here
ENV CKAN__PLUGINS envvars image_view text_view recline_view datastore datapusher userautoaddgroup

# Switch to the root user
USER root

# Copy python wheels from build stage
COPY --from=extbuild /wheels /srv/app/ext_wheels

# Install and enable the custom extensions, remove wheels
RUN set -ex && \
pip install --no-index --find-links=/srv/app/ext_wheels ckanext-userautoaddgroup && \
ckan config-tool "${APP_DIR}/production.ini" "ckan.plugins = ${CKAN__PLUGINS}" && \
chown -R ckan:ckan /srv/app && \
rm -rf /srv/app/ext_wheels

# Switch to the ckan user
USER ckan

0 comments on commit 1f07bc7

Please sign in to comment.