-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
See pnpm/pnpm#9014
- Loading branch information
yusing
committed
Feb 4, 2025
1 parent
2e14229
commit d54d3e9
Showing
1 changed file
with
8 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,13 +10,16 @@ WORKDIR /app | |
|
||
# Install dependencies based on the preferred package manager | ||
COPY package.json pnpm-lock.yaml ./ | ||
RUN corepack enable pnpm && \ | ||
# check issue on https://github.com/pnpm/pnpm/issues/9014 | ||
RUN npm install --global corepack@latest && \ | ||
corepack install -g [email protected]+sha1.$(npm view [email protected] dist.shasum) && \ | ||
pnpm i --frozen-lockfile --ignore-scripts | ||
|
||
# Rebuild the source code only when needed | ||
FROM base AS builder | ||
WORKDIR /app | ||
COPY --from=deps /app/node_modules ./node_modules | ||
FROM deps AS builder | ||
# FROM base AS builder | ||
# WORKDIR /app | ||
# COPY --from=deps /app/node_modules ./node_modules | ||
COPY . . | ||
RUN sed -i 's/config = {/config = { typescript: { ignoreBuildErrors: true }, eslint: { ignoreDuringBuilds: true },/' next.config.js | ||
|
||
|
@@ -25,7 +28,7 @@ RUN sed -i 's/config = {/config = { typescript: { ignoreBuildErrors: true }, esl | |
# Uncomment the following line in case you want to disable telemetry during the build. | ||
ENV NEXT_TELEMETRY_DISABLED=1 | ||
|
||
RUN corepack enable pnpm && pnpm run build | ||
RUN pnpm run build | ||
|
||
# Production image, copy all the files and run next | ||
FROM base AS runner | ||
|