From 7a8bd1f865d3e47dce96316c44283b0989cf84de Mon Sep 17 00:00:00 2001 From: Sylvain Zimmer Date: Wed, 25 Feb 2026 23:12:23 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=9A(ci)=20restore=20npm=20cache?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/e2e/Dockerfile | 3 ++- src/frontend/Dockerfile | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/e2e/Dockerfile b/src/e2e/Dockerfile index 68f0c4f3..1fb1c7bf 100644 --- a/src/e2e/Dockerfile +++ b/src/e2e/Dockerfile @@ -6,6 +6,7 @@ FROM docker:27-cli AS docker-cli # Main image FROM node:22-slim +ENV npm_config_cache=/tmp/npm-cache ENV PLAYWRIGHT_BROWSERS_PATH=/tmp/playwright-browsers ENV HOME=/tmp @@ -30,7 +31,7 @@ RUN npm install COPY . ./ # Fix ownership for the user (use numeric UID to avoid lookup issues) -RUN chown -R $DOCKER_USER /app +RUN chown -R $DOCKER_USER /tmp/npm-cache /app # Run test with unprivileged user USER $DOCKER_USER diff --git a/src/frontend/Dockerfile b/src/frontend/Dockerfile index c1ce376a..a3f61c92 100644 --- a/src/frontend/Dockerfile +++ b/src/frontend/Dockerfile @@ -1,9 +1,11 @@ FROM node:22-alpine AS frontend-deps +ENV npm_config_cache=/tmp/npm-cache + ARG DOCKER_USER=1000 WORKDIR /home/frontend/ -RUN chown -R ${DOCKER_USER} /home/frontend +RUN mkdir -p /tmp/npm-cache && chown -R ${DOCKER_USER} /tmp/npm-cache /home/frontend # Install deps and run all npm commands as the user running the container USER ${DOCKER_USER}