From acd26ea42753209efb9413177bfca374226b77a4 Mon Sep 17 00:00:00 2001 From: Julien Froidefond Date: Sat, 13 Dec 2025 12:15:40 +0100 Subject: [PATCH] chore: optimize Dockerfile by removing PNPM_HOME environment variable and using cache mount for pnpm store during dependency installation --- Dockerfile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 10f736e..8d84aad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,9 +4,6 @@ FROM node:20-alpine AS builder # Set working directory WORKDIR /app -# Configure pnpm store location -ENV PNPM_HOME="/app/.pnpm-store" - # Install dependencies for node-gyp RUN apk add --no-cache python3 make g++ @@ -23,8 +20,8 @@ COPY prisma ./prisma COPY tsconfig.json .eslintrc.json ./ COPY tailwind.config.ts postcss.config.js ./ -# Install dependencies with pnpm -RUN pnpm config set store-dir /app/.pnpm-store && \ +# Install dependencies with pnpm using cache mount for store +RUN --mount=type=cache,target=/root/.local/share/pnpm/store \ pnpm install --frozen-lockfile # Generate Prisma Client