From fb7785d0d4be68dd296cb3e9cc687adb5873f0bd Mon Sep 17 00:00:00 2001 From: Mikko Riippi Date: Thu, 8 Feb 2024 12:19:09 +0200 Subject: [PATCH] (HP-2047) Revert back to working docker images --- Dockerfile | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 227c842ff..f540f0f10 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # =============================================== -FROM registry.access.redhat.com/ubi9/nodejs-16 as appbase +FROM helsinkitest/node:16-slim as appbase # =============================================== # Offical image has npm log verbosity as info. More info - https://github.com/nodejs/docker-node#verbosity ENV NPM_CONFIG_LOGLEVEL warn @@ -14,15 +14,11 @@ ENV NPM_CONFIG_PREFIX=/app/.npm-global ENV PATH=$PATH:/app/.npm-global/bin # Yarn -# Install yarn and set yarn version -USER root -RUN curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | tee /etc/yum.repos.d/yarn.repo -RUN yum -y install yarn ENV YARN_VERSION 1.22.19 RUN yarn policies set-version $YARN_VERSION # Use non-root user -USER default +USER appuser # Copy package.json and package-lock.json/yarn.lock files COPY package*.json *yarn* ./ @@ -30,15 +26,15 @@ COPY package*.json *yarn* ./ # Install npm depepndencies ENV PATH /app/node_modules/.bin:$PATH -# USER root -# RUN bash /tools/apt-install.sh build-essential +USER root +RUN bash /tools/apt-install.sh build-essential -USER default +USER appuser RUN yarn config set network-timeout 300000 RUN yarn && yarn cache clean --force -# USER root -# RUN bash /tools/apt-cleanup.sh build-essential +USER root +RUN bash /tools/apt-cleanup.sh build-essential # ============================= FROM appbase as development @@ -49,7 +45,7 @@ ARG NODE_ENV=development ENV NODE_ENV $NODE_ENV # copy in our source code last, as it changes the most -COPY --chown=default:default . . +COPY --chown=appuser:appuser . . # Bake package.json start command into the image CMD ["react-scripts", "start"]