chore: update Dockerfile to set npm log level to error and streamline dependency copying for Prisma
This commit is contained in:
18
Dockerfile
18
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
|
||||
|
||||
Reference in New Issue
Block a user