51 lines
2.4 KiB
Docker
51 lines
2.4 KiB
Docker
FROM harbor.d4science.org/external-services/ckan-legacy-269:latest
|
|
|
|
LABEL org.d4science.image.licenses="EUPL-1.2" \
|
|
org.d4science.image.source="https://code-repo.d4science.org/D4Science/ckan-2-6-legacy/src/branch/ckan-2-6-bluecloud" \
|
|
org.d4science.image.vendor="D4Science <https://www.d4science.org>" \
|
|
org.d4science.image.authors="Francesco Mangiacrapa <francesco.mangiacrapa@isti.cnr.it>"
|
|
|
|
#Catalogue git repository
|
|
ARG CATALOGUE_REPOSITORY=https://code-repo.d4science.org/CKAN-Extensions/ckanext-d4science_theme.git
|
|
ARG CATALOGUE_DEFAULT_THEME_BRANCH_NAME=ckan-default
|
|
|
|
#!!!! Attention !!!!! Change this parameter for any CKAN intance !!!!!
|
|
#Catalogue custom git repository name for the specific instance.
|
|
ARG CATALOGUE_CUSTOM_THEME_BRANCH_NAME=ckan-bluecloud.d4science.org
|
|
#Customize this argument according to CKAN instance
|
|
ARG CATALOGUE_CUSTOM_HOSTNAME=${CATALOGUE_CUSTOM_THEME_BRANCH_NAME}
|
|
|
|
#CKAN filesystem paths
|
|
ARG USR_LOCAL_BIN=/usr/local/bin
|
|
ARG SRV_CUSTOMIZATIONS=/srv/ckan_customisations
|
|
|
|
# Environment variables
|
|
#ENV with path to the CKAN CUSTOMIZATION FOR THE SPECIFIC INSTANCE
|
|
ENV CKAN_CUSTOMIZATION_THEME=${CATALOGUE_CUSTOM_THEME_BRANCH_NAME}
|
|
ARG E_USR_LOCAL_BIN=${USR_LOCAL_BIN}
|
|
ARG E_SRV_CUSTOMIZATIONS=${SRV_CUSTOMIZATIONS}
|
|
|
|
# Install the git client (if not present in the base image)
|
|
# rm -rf /var/lib/apt/lists/* clean the apt cache, so reducing the final image dimension
|
|
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
|
|
|
# cleanup the path
|
|
RUN rm -rf $E_USR_LOCAL_BIN/*
|
|
|
|
# Clone the git repo of CKAN_DEFAULT_THEME in the Docker image
|
|
RUN git clone -b $CATALOGUE_DEFAULT_THEME_BRANCH_NAME $CATALOGUE_REPOSITORY $E_SRV_CUSTOMIZATIONS/$CATALOGUE_DEFAULT_THEME_BRANCH_NAME
|
|
# Clone the git repo of CKAN_CUSTOMIZATION_THEME in the Docker image
|
|
RUN git clone -b $CKAN_CUSTOMIZATION_THEME $CATALOGUE_REPOSITORY $E_SRV_CUSTOMIZATIONS/$CATALOGUE_CUSTOM_THEME_BRANCH_NAME
|
|
|
|
# Copy the files for the CKAN customisations
|
|
COPY conf/d4s-ckan-customizer $E_USR_LOCAL_BIN/
|
|
|
|
# Create the '/scripts' folder and copy the 'file_installer.sh' to apply the CKAN customisations
|
|
RUN mkdir $E_SRV_CUSTOMIZATIONS/scripts
|
|
COPY conf/file_installer.sh $E_SRV_CUSTOMIZATIONS/scripts/
|
|
RUN chmod +x $E_SRV_CUSTOMIZATIONS/scripts/file_installer.sh
|
|
RUN chown -R ckan:ckan $E_SRV_CUSTOMIZATIONS/
|
|
# Apply the CKAN customisations via 'file_installer.sh'
|
|
RUN $E_SRV_CUSTOMIZATIONS/scripts/file_installer.sh
|
|
|
|
CMD ["/usr/bin/supervisord", "-n"] |