From b0ab139ef6d408d829c3c6e184f5dc6af649227d Mon Sep 17 00:00:00 2001 From: moyoza Date: Wed, 21 Jan 2026 02:36:44 +0200 Subject: [PATCH] chore: update Dockerfile to set npm log level to error and streamline dependency copying for Prisma --- Dockerfile | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index ec83716..ea438b7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,7 @@ WORKDIR /app ENV NPM_CONFIG_FUND=false ENV NPM_CONFIG_AUDIT=false ENV NPM_CONFIG_UPDATE_NOTIFIER=false +ENV NPM_CONFIG_LOGLEVEL=error # Native deps (if you have any native modules) # vips-dev is required for building sharp native binaries @@ -36,7 +37,7 @@ RUN npm install -g node-gyp node-addon-api # SHARP_IGNORE_GLOBAL_LIBVIPS=1 tells sharp to use the system libvips we installed ENV SHARP_IGNORE_GLOBAL_LIBVIPS=1 RUN echo "📥 Installing npm dependencies..." && \ - npm ci --omit=dev --no-audit --no-fund + npm ci --omit=dev --no-audit --no-fund --loglevel=error ############################ @@ -91,17 +92,14 @@ COPY --from=builder /app/public ./public COPY --from=builder /app/.next/standalone ./ COPY --from=builder /app/.next/static ./.next/static -# If you use Prisma at runtime, you need schema + engines +# Prisma migrations at startup require Prisma CLI + its full dependency tree. +# Copy the complete production node_modules (avoid chasing missing transitive deps). +# NOTE: this intentionally overwrites the minimal standalone node_modules. +COPY --from=deps /app/node_modules ./node_modules + +# Prisma schema + migrations COPY --from=builder /app/prisma ./prisma COPY --from=builder /app/prisma.config.ts ./prisma.config.ts -COPY --from=builder /app/node_modules/.prisma ./node_modules/.prisma -COPY --from=builder /app/node_modules/@prisma ./node_modules/@prisma -COPY --from=builder /app/node_modules/prisma ./node_modules/prisma -COPY --from=builder /app/node_modules/.bin ./node_modules/.bin -COPY --from=builder /app/node_modules/valibot ./node_modules/valibot - -# Copy sharp binaries (required for Next.js image optimization) -COPY --from=builder /app/node_modules/sharp ./node_modules/sharp # Add runtime env check entrypoint (no secrets baked) COPY docker/entrypoint.sh /app/entrypoint.sh