From e13f63cf0c88dcb573264de7f79cf3e4f954a812 Mon Sep 17 00:00:00 2001 From: "T. Narantuya" Date: Sat, 30 Aug 2025 10:58:31 +0900 Subject: [PATCH] Update Dockerfile to install all dependencies for build and optimize production setup - Changed the installation command to include all dependencies necessary for the build process. - Updated comments for clarity regarding the installation of production dependencies and rebuilding critical native modules. --- apps/bff/Dockerfile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/bff/Dockerfile b/apps/bff/Dockerfile index 38d85671..31293d06 100644 --- a/apps/bff/Dockerfile +++ b/apps/bff/Dockerfile @@ -21,7 +21,7 @@ COPY pnpm-workspace.yaml package.json pnpm-lock.yaml ./ COPY packages/shared/package.json ./packages/shared/ COPY apps/bff/package.json ./apps/bff/ -# Install dependencies with frozen lockfile +# Install ALL dependencies (needed for build) RUN pnpm install --frozen-lockfile --prefer-offline # ===================================================== @@ -76,12 +76,11 @@ COPY pnpm-workspace.yaml package.json pnpm-lock.yaml ./ COPY packages/shared/package.json ./packages/shared/ COPY apps/bff/package.json ./apps/bff/ -# Install ONLY production dependencies (no dev dependencies) -# Skip scripts to avoid Husky, but allow other necessary postinstall scripts later +# Install ONLY production dependencies (lightweight) ENV HUSKY=0 RUN pnpm install --frozen-lockfile --prod --ignore-scripts -# Run only necessary postinstall scripts (Prisma, bcrypt, etc.) +# Rebuild only critical native modules RUN pnpm rebuild bcrypt @prisma/client @prisma/engines # Copy built applications from builder