From c5bcec4dba64332e9f168fc361e58db395a4d17f Mon Sep 17 00:00:00 2001 From: WangYK <62269186+AnotiaWang@users.noreply.github.com> Date: Thu, 13 Feb 2025 10:16:15 +0800 Subject: [PATCH] fix: various bugs in Dockerfile --- Dockerfile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index cc8ac3b..3e2ecc1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,21 @@ -FROM node:18-alpine AS builder +FROM node:20-alpine AS builder WORKDIR /app -COPY package.json package-lock.json ./ -RUN npm install --frozen-lockfile +COPY package.json pnpm-lock.yaml ./ +RUN npm i -g --force pnpm@9 +RUN pnpm install --frozen-lockfile COPY . . -RUN npm run build +ENV NODE_OPTIONS="--max_old_space_size=2048" +RUN pnpm build -FROM node:18-alpine AS runner +FROM node:20-alpine AS runner WORKDIR /app +# We only need the `.output` directory, which contains everything the app needs to run COPY --from=builder /app/.output .output -COPY --from=builder /app/node_modules node_modules COPY --from=builder /app/package.json . EXPOSE 3000