-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d1a9ae4
commit 4df996a
Showing
1 changed file
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |