Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,20 @@ FROM node:22-alpine AS base

# Install dependencies only when needed
FROM base AS deps
RUN apk add --no-cache libc6-compat git
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
WORKDIR /app

COPY package.json pnpm-lock.yaml* ./
# Approve build scripts as needed for dependencies using pnpm
RUN yarn global add pnpm && pnpm approve-builds && pnpm i --no-frozen-lockfile
ENV PNPM_ALLOW_NEW_BUILDS=true
ENV HUSKY=0
ENV CI=true
# Approve build scripts non-interactively and install dependencies.
# First install attempt populates pending builds (may exit non-zero),
# then approve all and install again to run build scripts.
RUN yarn global add pnpm \
&& (pnpm i --no-frozen-lockfile || true) \
&& pnpm approve-builds --all \
&& pnpm i --no-frozen-lockfile

# Rebuild the source code only when needed
FROM base AS builder
Expand Down
15 changes: 13 additions & 2 deletions Dockerfile.k8s
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,21 @@ FROM node:22-alpine AS base

# Install dependencies only when needed
FROM base AS deps
RUN apk add --no-cache libc6-compat
# Install required packages for build scripts and git for husky
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
WORKDIR /app

COPY package.json pnpm-lock.yaml* ./
RUN yarn global add pnpm && pnpm approve-builds && pnpm i --no-frozen-lockfile
ENV PNPM_ALLOW_NEW_BUILDS=true
ENV HUSKY=0
ENV CI=true
# Approve build scripts non-interactively and install dependencies.
# First install attempt populates pending builds (may exit non-zero),
# then approve all and install again to run build scripts.
RUN yarn global add pnpm \
&& (pnpm i --no-frozen-lockfile || true) \
&& pnpm approve-builds --all \
&& pnpm i --no-frozen-lockfile


# Rebuild the source code only when needed
Expand All @@ -17,6 +27,7 @@ COPY --from=deps /app/node_modules ./node_modules
COPY . .

ENV NEXT_TELEMETRY_DISABLED 1
ENV PNPM_ALLOW_NEW_BUILDS=true
ARG NEXT_PUBLIC_BACKEND_URL="https://meitrex.de/graphql"
ARG NEXT_PUBLIC_OAUTH_REDIRECT_URL="https://meitrex.de"
ARG NEXT_PUBLIC_OAUTH_CLIENT_ID="frontend"
Expand Down
Loading