From 6cba3cea097448f550fc0c77529721bb96d88486 Mon Sep 17 00:00:00 2001 From: Antonio Llamas Date: Mon, 30 May 2022 22:27:10 +0200 Subject: [PATCH] Fix permission issue on npm install This alpine version is overriding the custom user: - https://github.com/nodejs/docker-node/issues/740 - https://stackoverflow.com/questions/44766665/how-do-i-docker-copy-as-non-root?answertab=votes#tab-top --- client/Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/Dockerfile b/client/Dockerfile index 1027baa..6ab0070 100644 --- a/client/Dockerfile +++ b/client/Dockerfile @@ -3,10 +3,10 @@ FROM node:16.15.0-alpine3.15 RUN addgroup app && adduser -S -G app app USER app -WORKDIR /app -COPY package*.json ./ -RUN npm install -COPY . . +WORKDIR /app +COPY --chown=app:node package*.json ./ +RUN npm install +COPY --chown=app:node . . EXPOSE 3000