From 34c130e6ebeb8dadb8b7d1a0cc539485d0de03a9 Mon Sep 17 00:00:00 2001 From: Pauline Date: Sat, 28 Sep 2024 20:31:54 +0100 Subject: [PATCH] Fix npm cache permission issues by setting new dir --- Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 721ae7c..acb5693 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,8 +5,12 @@ RUN mkdir -p /app WORKDIR /app +ENV NPM_CONFIG_CACHE=/home/node/.npm + COPY package*.json ./ +RUN mkdir -p $NPM_CONFIG_CACHE && chown -R node:node $NPM_CONFIG_CACHE + RUN npm install COPY . . @@ -15,5 +19,4 @@ RUN npm run build EXPOSE 3000 -# Start the app on port 4455 as recommended by ory CMD ["npm", "start", "--", "-p", "3000"]