diff --git a/Dockerfile b/Dockerfile index 8aefbcda3..35c3ec152 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,20 +9,23 @@ ENV NEXT_PUBLIC_APP_REVISION=${APP_REVISION} RUN apk add curl jq -USER node WORKDIR /app -COPY --chown=node src/*.json ./ +COPY src/*.json ./ RUN npm install --legacy-peer-deps -COPY --chown=node src ./ +COPY src ./ ARG GITHUB_API_TOKEN ENV COOKIE_SECRET=change_me RUN npm run build -ENV HOME=/home/node +# Create the /.npm directory and grant access to group 0 to allow npm v9 to work +# See: https://docs.openshift.com/container-platform/4.11/openshift_images/create-images.html#use-uid_create-images +RUN mkdir /.npm +RUN chgrp -R 0 /.npm && \ + chmod -R g=u /.npm ENTRYPOINT [ "npm", "run" ] CMD [ "start"] diff --git a/feeds/Dockerfile b/feeds/Dockerfile index 0fab49d48..71762d635 100644 --- a/feeds/Dockerfile +++ b/feeds/Dockerfile @@ -9,14 +9,17 @@ ENV APP_VERSION=${APP_VERSION} ARG APP_REVISION ENV APP_REVISION=${APP_REVISION} -USER node WORKDIR /app -COPY --chown=node package*.json ./ +COPY package*.json ./ RUN npm install -COPY --chown=node . ./ +COPY . ./ -ENV HOME=/home/node +# Create the /.npm directory and grant access to group 0 to allow npm v9 to work +# See: https://docs.openshift.com/container-platform/4.11/openshift_images/create-images.html#use-uid_create-images +RUN mkdir /.npm +RUN chgrp -R 0 /.npm && \ + chmod -R g=u /.npm CMD [ "node", "index.js" ]