Skip to content

[Bug]: docker compose up leads to npm cache permission error #1441

Discussion options

You must be logged in to vote

I was able to get around it with the following changes

diff --git a/Dockerfile b/Dockerfile
index 1dac186b..ec3910bc 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,6 +1,9 @@
 # Base node image
 FROM node:19-alpine AS node
 
+ARG UID
+ARG GID
+
 COPY . /app
 WORKDIR /app
 
@@ -10,7 +13,8 @@ RUN apk --no-cache add curl && \
     # This will preserve any existing env file if it's already in source
     # otherwise it will create a new one
     touch .env && \
-    # Build deps in seperate 
+    mkdir /.npm && \
+    chown -R $UID:$GID /.npm && \
     npm ci
 
 # React client build
diff --git a/docker-compose.yml b/docker-compose.yml
index 5f7fb0b7..2744ffe8 100644
--- a/docker-compose.yml
++…

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
1 reply
@FabianHertwig
Comment options

Comment options

You must be logged in to vote
4 replies
@sixlive
Comment options

Answer selected by FabianHertwig
@FabianHertwig
Comment options

@dims12
Comment options

@danny-avila
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
4 participants
Converted from issue

This discussion was converted from issue #1439 on December 27, 2023 12:51.