From 67ad5a856a22af5edd964b17f2ff0c963615b622 Mon Sep 17 00:00:00 2001 From: barrfalk Date: Wed, 13 Dec 2023 11:24:26 -0800 Subject: [PATCH 1/2] Update Dockerfile --- Dockerfile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 811b65e..87c8d81 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,11 @@ FROM docker.io/node:16.15.0-alpine ENV NO_UPDATE_NOTIFIER=true -WORKDIR /opt/app-root/src/app +WORKDIR /home/node/app COPY . /opt/app-root/src -USER node -RUN npm install --unsafe-perm \ - && npm run all:ci \ +RUN npm run all:ci \ && npm run all:build \ && npm run client:purge EXPOSE 8000 -# Switch to non-root user + CMD ["npm", "run", "start"] From 79882b896143d6e53cc0582205b3aac2aa546b6a Mon Sep 17 00:00:00 2001 From: barrfalk Date: Wed, 13 Dec 2023 11:31:51 -0800 Subject: [PATCH 2/2] Update Dockerfile --- Dockerfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 87c8d81..67cb178 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,14 @@ FROM docker.io/node:16.15.0-alpine ENV NO_UPDATE_NOTIFIER=true -WORKDIR /home/node/app +WORKDIR /opt/app-root/src/app COPY . /opt/app-root/src -RUN npm run all:ci \ + +# Install dependencies with --unsafe-perm flag and build the application +RUN npm install --unsafe-perm \ + && npm run all:ci \ && npm run all:build \ && npm run client:purge -EXPOSE 8000 +EXPOSE 8000 CMD ["npm", "run", "start"]