From 2879bcb9697d73e6f02cb3bcaaf4a318407c253a Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Wed, 9 Oct 2024 03:17:20 -0700 Subject: [PATCH] fix dockerfile global npm install location --- Dockerfile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7e2ce461..4f8ecf6f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -240,12 +240,13 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-$TARGETARCH$T ) | tee -a /VERSION.txt # Install Node dependencies -ENV PATH="/home/$ARCHIVEBOX_USER/.local/bin:$PATH" +ENV PATH="/home/$ARCHIVEBOX_USER/.npm/bin:$PATH" USER $ARCHIVEBOX_USER -RUN --mount=type=cache,target=/home/$ARCHIVEBOX_USER/.npm,sharing=locked,id=npm-$TARGETARCH$TARGETVARIANT,uid=$DEFAULT_PUID,gid=$DEFAULT_PGID \ - echo "[+] Installing NPM extractor dependencies globally..." \ - && npm config set prefix '~/.local/' \ - && npm install --global --prefer-offline --no-fund --no-audit --cache /home/$ARCHIVEBOX_USER/.npm \ +WORKDIR "/home/$ARCHIVEBOX_USER/.npm" +RUN --mount=type=cache,target=/home/$ARCHIVEBOX_USER/.npm_cache,sharing=locked,id=npm-$TARGETARCH$TARGETVARIANT,uid=$DEFAULT_PUID,gid=$DEFAULT_PGID \ + echo "[+] Installing NPM extractor dependencies in /home/$ARCHIVEBOX_USER/.npm..." \ + && npm config set prefix "/home/$ARCHIVEBOX_USER/.npm" \ + && npm install --global --prefer-offline --no-fund --no-audit --cache "/home/$ARCHIVEBOX_USER/.npm_cache" \ "@postlight/parser@^2.2.3" \ "readability-extractor@github:ArchiveBox/readability-extractor" \ "single-file-cli@^1.1.54" \