Skip to content

Instantly share code, notes, and snippets.

# Stage 0: Define base image and dependencies caching
# This stage installs pnpm and caches global dependencies, leveraging Docker's layer caching.
FROM node:20-alpine AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
RUN npm install -g pnpm@latest
WORKDIR /app