From b10dbcb23fd9ee7c8fa23e1a6143d687e57d8aea Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Mon, 23 Feb 2026 02:26:41 +0100 Subject: [PATCH] fix(ci): Persist Next.js BuildKit cache mount to runner stage --- Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2dd8349f..fd66d89b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,7 +42,9 @@ CMD ["pnpm", "dev:local"] # Stage 3: Builder (Production) FROM base AS builder RUN --mount=type=cache,target=/app/.next/cache,id=nextjs-cache \ - pnpm build + pnpm build && \ + mkdir -p /app/.next-cache-tmp && \ + cp -r /app/.next/cache/* /app/.next-cache-tmp/ || true # Stage 3: Runner FROM registry.infra.mintel.me/mintel/runtime:v1.7.10 AS runner @@ -61,6 +63,6 @@ ENV NODE_ENV=production COPY --from=builder --chown=nextjs:nodejs /app/public ./public COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static -COPY --from=builder --chown=nextjs:nodejs /app/.next/cache ./.next/cache +COPY --from=builder --chown=nextjs:nodejs /app/.next-cache-tmp ./.next/cache CMD ["node", "server.js"]