Skip to content

Commit 776f827

Browse files
authored
Merge pull request #190 from MEITREX/FoPro_WS_UML-Assessment
Update docker part 3
2 parents 2eaaf9f + 3e8c270 commit 776f827

2 files changed

Lines changed: 24 additions & 5 deletions

File tree

Dockerfile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,20 @@ FROM node:22-alpine AS base
22

33
# Install dependencies only when needed
44
FROM 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
66
WORKDIR /app
77

88
COPY 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
1321
FROM base AS builder

Dockerfile.k8s

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,21 @@ FROM node:22-alpine AS base
22

33
# Install dependencies only when needed
44
FROM 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
67
WORKDIR /app
78

89
COPY 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
1727
COPY . .
1828

1929
ENV NEXT_TELEMETRY_DISABLED 1
30+
ENV PNPM_ALLOW_NEW_BUILDS=true
2031
ARG NEXT_PUBLIC_BACKEND_URL="https://meitrex.de/graphql"
2132
ARG NEXT_PUBLIC_OAUTH_REDIRECT_URL="https://meitrex.de"
2233
ARG NEXT_PUBLIC_OAUTH_CLIENT_ID="frontend"

0 commit comments

Comments
 (0)