From f37751cc9cfbc56224346c705ca0eed548d8c5e3 Mon Sep 17 00:00:00 2001 From: SevLG Date: Thu, 11 Jan 2024 14:13:00 +0100 Subject: [PATCH 1/2] Added chown of /tmp for node user in Dockerfile --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index f478e4a..581e23e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,7 @@ WORKDIR /app ENV PATH /app/node_modules/.bin:$PATH RUN chown -R node:node /app RUN chown -R node:node /usr +RUN chown -R node:node /tmp USER node # Cache and Install dependencies COPY ./react-app/package.json . From 63700a6fd60e774ce33a5f87cc78cc2e26845c73 Mon Sep 17 00:00:00 2001 From: SevLG Date: Thu, 11 Jan 2024 14:18:54 +0100 Subject: [PATCH 2/2] Added explicit ownership to copied files to node in docker image --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 581e23e..ed9edec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,12 +7,12 @@ RUN chown -R node:node /usr RUN chown -R node:node /tmp USER node # Cache and Install dependencies -COPY ./react-app/package.json . -COPY ./react-app/package-lock.json . +COPY --chown=node:node ./react-app/package.json . +COPY --chown=node:node ./react-app/package-lock.json . RUN npm ci RUN npm install react-scripts -g # Copy app files -COPY ./react-app/ . +COPY --chown=node:node ./react-app/ . RUN npm run build # production environment