From 67e8198c01f06001b4deaa3a678802210995f51d Mon Sep 17 00:00:00 2001 From: Pablo Saiz Date: Wed, 6 Mar 2024 14:50:21 +0100 Subject: [PATCH] docker: Start the build with the portal image instead of invenio --- Dockerfile | 43 ++------------------------------------ scripts/create-instance.sh | 3 +++ 2 files changed, 5 insertions(+), 41 deletions(-) diff --git a/Dockerfile b/Dockerfile index 83507c3231..4ef866f2e2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,47 +22,8 @@ # waive the privileges and immunities granted to it by virtue of its status # as an Intergovernmental Organization or submit itself to any jurisdiction. -# Use Invenio's alma image with Python-3.9 -FROM registry.cern.ch/inveniosoftware/almalinux:1 - -# Use XRootD 5.6.9 -ENV XROOTD_VERSION=5.6.9 - -# Install CERN Open Data Portal web node pre-requisites -# hadolint ignore=DL3033 -RUN yum install -y \ - ca-certificates \ - cmake3 \ - epel-release \ - libuuid-devel \ - rlwrap \ - vim && \ - yum groupinstall -y "Development Tools" && \ - yum clean -y all - -RUN echo "Will install xrootd version: $XROOTD_VERSION (latest if empty)" && \ - yum install -y xrootd-"$XROOTD_VERSION" python3-xrootd-"$XROOTD_VERSION" && \ - yum clean -y all - -RUN pip uninstall pipenv -y && pip install --upgrade pip==20.2.4 setuptools==68.2.2 wheel==0.36.2 && \ - npm install -g --unsafe-perm node-sass@6.0.1 clean-css@3.4.24 requirejs@2.3.6 uglify-js@3.12.1 jsonlint@1.6.3 d3@6.3.1 - -# Change group to root to support OpenShift runtime -RUN chgrp -R 0 "${INVENIO_INSTANCE_PATH}" && \ - chmod -R g=u "${INVENIO_INSTANCE_PATH}" - -# Create `code` dir and set Invenio user as owner -ENV CODE_DIR=/code -RUN mkdir ${CODE_DIR} && chown invenio:root ${CODE_DIR} - -# Run application as Invenio user -USER ${INVENIO_USER_ID} - -# Set default Invenio user Python base for site-packages -ENV PYTHONUSERBASE=${INVENIO_INSTANCE_PATH}/python - -# Add Invenio user Python base to global PATH -ENV PATH=$PATH:${INVENIO_INSTANCE_PATH}/python/bin +# hadolint ignore=DL3007 +FROM registry.cern.ch/cernopendata/cernopendata-portal:latest # Add CERN Open Data Portal sources to `code` and work there WORKDIR ${CODE_DIR} diff --git a/scripts/create-instance.sh b/scripts/create-instance.sh index c92599e1bb..70096e5567 100755 --- a/scripts/create-instance.sh +++ b/scripts/create-instance.sh @@ -28,6 +28,9 @@ set -o nounset mkdir -p "${INVENIO_INSTANCE_PATH}" cd "${INVENIO_INSTANCE_PATH}"/static +# cleanup the previous installation +rm -rf "${INVENIO_INSTANCE_PATH}"/static/* + npm install git+https://github.com/cernopendata/demobbed-viewer.git --prefix $INVENIO_INSTANCE_PATH/static npm install ispy-webgl@0.9.8-COD3.11 --prefix $INVENIO_INSTANCE_PATH/static