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.
This commit is contained in:
parent
cc7235e79c
commit
e13f63cf0c
@ -21,7 +21,7 @@ COPY pnpm-workspace.yaml package.json pnpm-lock.yaml ./
|
|||||||
COPY packages/shared/package.json ./packages/shared/
|
COPY packages/shared/package.json ./packages/shared/
|
||||||
COPY apps/bff/package.json ./apps/bff/
|
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
|
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 packages/shared/package.json ./packages/shared/
|
||||||
COPY apps/bff/package.json ./apps/bff/
|
COPY apps/bff/package.json ./apps/bff/
|
||||||
|
|
||||||
# Install ONLY production dependencies (no dev dependencies)
|
# Install ONLY production dependencies (lightweight)
|
||||||
# Skip scripts to avoid Husky, but allow other necessary postinstall scripts later
|
|
||||||
ENV HUSKY=0
|
ENV HUSKY=0
|
||||||
RUN pnpm install --frozen-lockfile --prod --ignore-scripts
|
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
|
RUN pnpm rebuild bcrypt @prisma/client @prisma/engines
|
||||||
|
|
||||||
# Copy built applications from builder
|
# Copy built applications from builder
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user