diff --git a/apps/bff/Dockerfile b/apps/bff/Dockerfile index 03c6bc10..018e0727 100644 --- a/apps/bff/Dockerfile +++ b/apps/bff/Dockerfile @@ -71,21 +71,21 @@ RUN corepack enable && corepack prepare pnpm@10.15.0 --activate WORKDIR /app -# Copy workspace configuration for production install +# Copy workspace configuration 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; skip lifecycle scripts to avoid Husky prepare -# Prisma client and native assets are generated in the builder stage and copied below -ENV HUSKY=0 -RUN pnpm install --recursive --frozen-lockfile --prod --ignore-scripts - -# Copy built applications and Prisma client +# Copy built applications and dependencies from builder COPY --from=builder /app/packages/shared/dist ./packages/shared/dist COPY --from=builder /app/apps/bff/dist ./apps/bff/dist COPY --from=builder /app/apps/bff/prisma ./apps/bff/prisma +# Copy node_modules from builder (includes all dependencies) +COPY --from=builder /app/node_modules ./node_modules +COPY --from=builder /app/packages/shared/node_modules ./packages/shared/node_modules +COPY --from=builder /app/apps/bff/node_modules ./apps/bff/node_modules + # Generate Prisma client in the production image (ensures engines and client are present) WORKDIR /app/apps/bff RUN pnpm prisma generate