Switched to pnpm from yarn.
This commit is contained in:
17
Dockerfile
17
Dockerfile
@@ -3,10 +3,9 @@ FROM node:22-alpine AS deps
|
||||
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
|
||||
RUN apk add --no-cache libc6-compat
|
||||
WORKDIR /app
|
||||
COPY package.json yarn.lock ./
|
||||
# Add yarn timeout to handle slow CPU when Github Actions
|
||||
RUN yarn config set network-timeout 300000
|
||||
RUN yarn install --frozen-lockfile
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
RUN npm install -g pnpm
|
||||
RUN pnpm install --frozen-lockfile
|
||||
|
||||
# Rebuild the source code only when needed
|
||||
FROM node:22-alpine AS builder
|
||||
@@ -22,7 +21,8 @@ ENV BASE_PATH=$BASE_PATH
|
||||
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
RUN yarn build-docker
|
||||
RUN npm install -g pnpm
|
||||
RUN pnpm build-docker
|
||||
|
||||
# Production image, copy all the files and run next
|
||||
FROM node:22-alpine AS runner
|
||||
@@ -36,10 +36,13 @@ ENV NODE_OPTIONS=$NODE_OPTIONS
|
||||
|
||||
RUN addgroup --system --gid 1001 nodejs
|
||||
RUN adduser --system --uid 1001 nextjs
|
||||
RUN npm install -g pnpm
|
||||
|
||||
RUN set -x \
|
||||
&& apk add --no-cache curl \
|
||||
&& yarn add npm-run-all dotenv semver prisma@6.1.0
|
||||
&& pnpm add npm-run-all dotenv prisma@6.1.0
|
||||
|
||||
RUN chown -R nextjs:nodejs node_modules/
|
||||
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/public ./public
|
||||
COPY --from=builder /app/prisma ./prisma
|
||||
@@ -59,4 +62,4 @@ EXPOSE 3000
|
||||
ENV HOSTNAME=0.0.0.0
|
||||
ENV PORT=3000
|
||||
|
||||
CMD ["yarn", "start-docker"]
|
||||
CMD ["pnpm", "start-docker"]
|
||||
|
||||
Reference in New Issue
Block a user