chore: optimize Dockerfile by removing PNPM_HOME environment variable and using cache mount for pnpm store during dependency installation
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 5m36s

This commit is contained in:
Julien Froidefond
2025-12-13 12:15:40 +01:00
parent 4fac95a1d8
commit acd26ea427

View File

@@ -4,9 +4,6 @@ FROM node:20-alpine AS builder
# Set working directory # Set working directory
WORKDIR /app WORKDIR /app
# Configure pnpm store location
ENV PNPM_HOME="/app/.pnpm-store"
# Install dependencies for node-gyp # Install dependencies for node-gyp
RUN apk add --no-cache python3 make g++ RUN apk add --no-cache python3 make g++
@@ -23,8 +20,8 @@ COPY prisma ./prisma
COPY tsconfig.json .eslintrc.json ./ COPY tsconfig.json .eslintrc.json ./
COPY tailwind.config.ts postcss.config.js ./ COPY tailwind.config.ts postcss.config.js ./
# Install dependencies with pnpm # Install dependencies with pnpm using cache mount for store
RUN pnpm config set store-dir /app/.pnpm-store && \ RUN --mount=type=cache,target=/root/.local/share/pnpm/store \
pnpm install --frozen-lockfile pnpm install --frozen-lockfile
# Generate Prisma Client # Generate Prisma Client