From e4786d21adc6c4f3aaa862ac2944a55eb42cf35d Mon Sep 17 00:00:00 2001 From: Yuzu Date: Sat, 17 Aug 2024 21:20:35 +0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=A6=20build:=20Switched=20to=20corepac?= =?UTF-8?q?k=20pnpm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index b6a928f..82e8e52 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,9 @@ FROM debian AS build + +ENV PNPM_HOME="/pnpm" +ENV PATH="$PNPM_HOME:$PATH" +ENV CI=true + WORKDIR /home/node/app COPY . . @@ -8,15 +13,16 @@ RUN apt-get update -y RUN apt-get -y install curl gnupg git dh-python make g++ iputils-ping ffmpeg RUN curl -sL https://deb.nodesource.com/setup_21.x | bash - RUN apt-get -y install nodejs -RUN npm i -g yarn -RUN yarn +RUN corepack enable + +RUN pnpm install WORKDIR /home/node/app/NekoMelody -RUN yarn +RUN pnpm install WORKDIR /home/node/app -RUN yarn build +RUN pnpm run build FROM debian WORKDIR /home/node/app @@ -28,12 +34,13 @@ RUN apt-get update -y RUN apt-get -y install yt-dlp RUN curl -sL https://deb.nodesource.com/setup_21.x | bash - RUN apt-get -y install nodejs -RUN npm i -g yarn + +RUN corepack enable COPY --from=build /home/node/app/package.json . COPY --from=build /home/node/app/yarn.lock . -RUN yarn +RUN pnpm install COPY --from=build /home/node/app/prisma ./prisma/ RUN yarn prisma generate