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}