From 792cde122cb369e204707aa7c3605921f8a5d985 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Wed, 3 Apr 2024 21:53:28 -0700 Subject: [PATCH] Update dockerfile permissions --- api/Dockerfile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/api/Dockerfile b/api/Dockerfile index 381b7ec1ff..64bbc6bd56 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -2,14 +2,19 @@ # This DockerFile is used for deployments only, please do not change for other purposes. It will break our deployment. # #################################################################################################################### -FROM node:18 +FROM registry.access.redhat.com/ubi9/nodejs-18 ENV HOME=/opt/app-root/src RUN mkdir -p $HOME +RUN chgrp -R 0 $HOME && \ + chmod -R g+rwX $HOME + WORKDIR $HOME +USER 0 + # Copy the package files only # A wildcard is used to ensure both package.json AND package-lock.json are copied where available (npm@5+) COPY ./package*.json ./ @@ -18,7 +23,7 @@ COPY ./package*.json ./ # RUN npm install --only=production RUN npm install -ENV PATH /opt/rh/rh-nodejs8/root/usr/bin:${HOME}/node_modules/.bin/:${HOME}/app.npm-global/bin/:${HOME}/bin:${HOME}/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +ENV PATH ${HOME}/node_modules/.bin/:${HOME}/.npm-global/bin/:${HOME}/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin # Copy the rest of the files COPY . ./ @@ -34,5 +39,7 @@ VOLUME ${HOME} EXPOSE 6100 +USER 1001 + # Application Entry point CMD ["npm", "run", "start"]