File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,12 +2,20 @@ FROM node:22-alpine AS base
22
33# Install dependencies only when needed
44FROM base AS deps
5- RUN apk add --no-cache libc6-compat git
5+ RUN apk add --no-cache libc6-compat git build-base cairo-dev pango-dev giflib-dev libjpeg-turbo-dev libpng-dev python3 make g++ pkgconfig
66WORKDIR /app
77
88COPY package.json pnpm-lock.yaml* ./
9- # Approve build scripts as needed for dependencies using pnpm
10- RUN yarn global add pnpm && pnpm approve-builds && pnpm i --no-frozen-lockfile
9+ ENV PNPM_ALLOW_NEW_BUILDS=true
10+ ENV HUSKY=0
11+ ENV CI=true
12+ # Approve build scripts non-interactively and install dependencies.
13+ # First install attempt populates pending builds (may exit non-zero),
14+ # then approve all and install again to run build scripts.
15+ RUN yarn global add pnpm \
16+ && (pnpm i --no-frozen-lockfile || true) \
17+ && pnpm approve-builds --all \
18+ && pnpm i --no-frozen-lockfile
1119
1220# Rebuild the source code only when needed
1321FROM base AS builder
Original file line number Diff line number Diff line change @@ -2,11 +2,21 @@ FROM node:22-alpine AS base
22
33# Install dependencies only when needed
44FROM base AS deps
5- RUN apk add --no-cache libc6-compat
5+ # Install required packages for build scripts and git for husky
6+ RUN apk add --no-cache libc6-compat git build-base cairo-dev pango-dev giflib-dev libjpeg-turbo-dev libpng-dev python3 make g++ pkgconfig
67WORKDIR /app
78
89COPY package.json pnpm-lock.yaml* ./
9- RUN yarn global add pnpm && pnpm approve-builds && pnpm i --no-frozen-lockfile
10+ ENV PNPM_ALLOW_NEW_BUILDS=true
11+ ENV HUSKY=0
12+ ENV CI=true
13+ # Approve build scripts non-interactively and install dependencies.
14+ # First install attempt populates pending builds (may exit non-zero),
15+ # then approve all and install again to run build scripts.
16+ RUN yarn global add pnpm \
17+ && (pnpm i --no-frozen-lockfile || true) \
18+ && pnpm approve-builds --all \
19+ && pnpm i --no-frozen-lockfile
1020
1121
1222# Rebuild the source code only when needed
@@ -17,6 +27,7 @@ COPY --from=deps /app/node_modules ./node_modules
1727COPY . .
1828
1929ENV NEXT_TELEMETRY_DISABLED 1
30+ ENV PNPM_ALLOW_NEW_BUILDS=true
2031ARG NEXT_PUBLIC_BACKEND_URL="https://meitrex.de/graphql"
2132ARG NEXT_PUBLIC_OAUTH_REDIRECT_URL="https://meitrex.de"
2233ARG NEXT_PUBLIC_OAUTH_CLIENT_ID="frontend"
You can’t perform that action at this time.
0 commit comments