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,15 +2,16 @@ 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+ RUN apk add --no-cache libc6-compat git
66WORKDIR /app
77
88COPY package.json pnpm-lock.yaml* ./
9- RUN yarn global add pnpm && pnpm i --no-frozen-lockfile
10-
9+ # Approve build scripts as needed for dependencies using pnpm
10+ RUN yarn global add pnpm && pnpm approve-builds && pnpm i --no-frozen-lockfile
1111
1212# Rebuild the source code only when needed
1313FROM base AS builder
14+ RUN apk add --no-cache git
1415WORKDIR /app
1516COPY --from=deps /app/node_modules ./node_modules
1617COPY . .
@@ -21,11 +22,10 @@ ARG NEXT_PUBLIC_OAUTH_REDIRECT_URL="https://orange.informatik.uni-stuttgart.de"
2122ARG NEXT_PUBLIC_OAUTH_CLIENT_ID="frontend"
2223ARG NEXT_PUBLIC_OAUTH_AUTHORITY="https://orange.informatik.uni-stuttgart.de/keycloak/realms/GITS"
2324
24- RUN yarn global add pnpm@latest-8 \
25+ RUN yarn global add pnpm@latest-8 \
2526 && mkdir -p ./__generated__ \
2627 && rm -rf ./mockserver \
27- && pnpm run build
28-
28+ && pnpm run build
2929
3030# Production image, copy all the files and run next
3131FROM base AS runner
Original file line number Diff line number Diff line change @@ -6,11 +6,12 @@ RUN apk add --no-cache libc6-compat
66WORKDIR /app
77
88COPY package.json pnpm-lock.yaml* ./
9- RUN yarn global add pnpm && pnpm i --no-frozen-lockfile
9+ RUN yarn global add pnpm && pnpm approve-builds && pnpm i --no-frozen-lockfile
1010
1111
1212# Rebuild the source code only when needed
1313FROM base AS builder
14+ RUN apk add --no-cache git
1415WORKDIR /app
1516COPY --from=deps /app/node_modules ./node_modules
1617COPY . .
@@ -22,10 +23,10 @@ ARG NEXT_PUBLIC_OAUTH_CLIENT_ID="frontend"
2223ARG NEXT_PUBLIC_OAUTH_AUTHORITY="https://meitrex.de/keycloak/realms/GITS"
2324ARG NEXT_PUBLIC_GITHUB_CLIENT_ID="Iv23li4YaE8QambyYkY8"
2425
25- RUN yarn global add pnpm@latest-8 \
26+ RUN yarn global add pnpm@latest-8 \
2627 && mkdir -p ./__generated__ \
2728 && rm -rf ./mockserver \
28- && pnpm run build
29+ && pnpm run build
2930
3031
3132# Production image, copy all the files and run next
You can’t perform that action at this time.
0 commit comments