From d1a1f16d649682192c33f7ca7fbf04756b5c99a8 Mon Sep 17 00:00:00 2001 From: Innei Date: Wed, 15 Feb 2023 22:19:29 +0800 Subject: [PATCH] fix: dockerfile build Signed-off-by: Innei --- Dockerfile | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/Dockerfile b/Dockerfile index 761a04141..cb3bc87ec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,27 +1,12 @@ -# Install dependencies only when needed -FROM node:18-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 pnpm-lock.yaml ./ -RUN npm i -g pnpm -RUN pnpm install - -# If using npm with a `package-lock.json` comment out above and use below instead -# COPY package.json package-lock.json ./ -# RUN npm ci - # Rebuild the source code only when needed FROM node:18-alpine AS builder + +RUN apk add --no-cache libc6-compat git +RUN npm i -g pnpm WORKDIR /app -COPY --from=deps /app/node_modules ./node_modules COPY . . -# Next.js collects completely anonymous telemetry data about general usage. -# Learn more here: https://nextjs.org/telemetry -# Uncomment the following line in case you want to disable telemetry during the build. -# ENV NEXT_TELEMETRY_DISABLED 1 - +RUN pnpm install RUN npm run build # If using npm comment out above and use below instead