diff --git a/Dockerfile b/Dockerfile index c728cf0..a6f73af 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,15 @@ FROM node:20-alpine AS base +# Install pnpm +RUN corepack enable && corepack prepare pnpm@latest --activate + # Install dependencies only when needed FROM base AS deps RUN apk add --no-cache libc6-compat WORKDIR /app -COPY package.json package-lock.json* ./ -RUN npm ci +COPY package.json pnpm-lock.yaml ./ +RUN pnpm install --frozen-lockfile # Rebuild the source code only when needed FROM base AS builder @@ -17,7 +20,7 @@ COPY . . ENV NEXT_TELEMETRY_DISABLED=1 ENV NODE_ENV=production -RUN npm run build +RUN pnpm run build # Production image, copy all the files and run next FROM base AS runner