From 74b73d1b84a3b9bc8816c72a8ae259ec1ba5576b Mon Sep 17 00:00:00 2001 From: denshooter Date: Wed, 4 Mar 2026 14:45:55 +0100 Subject: [PATCH] perf: add Docker build cache for Next.js Mount .next/cache as a BuildKit cache volume during build to persist the Next.js build cache across Docker rebuilds. Eliminates the 'No build cache found' warning and speeds up subsequent builds. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d0e4cc7..d93f686 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,10 +31,10 @@ RUN npx prisma generate # Copy source code (this invalidates cache when code changes) COPY . . -# Build the application +# Build the application (mount cache for faster rebuilds) ENV NEXT_TELEMETRY_DISABLED=1 ENV NODE_ENV=production -RUN npm run build +RUN --mount=type=cache,target=/app/.next/cache npm run build # Verify standalone output was created and show structure for debugging RUN if [ ! -d .next/standalone ]; then \