From b608e8e5253800356f2128dffd0a229ffaf55317 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Thu, 18 Apr 2024 21:22:50 -0400 Subject: [PATCH] Using corepack to install pnpm, instead of npm -g (#2431) --- Dockerfile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index ccf7c71d..2c6e9209 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:21-alpine as builder +FROM node:alpine as builder # Added vips-dev and pkgconfig so that local vips is used instead of prebuilt # Done for two reasons: @@ -6,8 +6,11 @@ FROM node:21-alpine as builder # - It can break depending on the CPU (https://github.com/LemmyNet/lemmy-ui/issues/1566) RUN apk update && apk upgrade && apk add --no-cache curl python3 build-base gcc wget git vips-dev pkgconfig -# Install node-gyp and pnpm -RUN npm install -g pnpm node-gyp +# Enable corepack to use pnpm +RUN corepack enable + +# Install node-gyp +RUN npm install -g node-gyp WORKDIR /usr/src/app @@ -40,7 +43,7 @@ RUN rm -rf ./node_modules/import-sort-parser-typescript RUN rm -rf ./node_modules/typescript RUN rm -rf ./node_modules/npm -FROM node:21-alpine as runner +FROM node:alpine as runner ENV NODE_ENV=production RUN apk update && apk add --no-cache curl vips-cpp && rm -rf /var/cache/apk/*