Compare commits

..

2 Commits

Author SHA1 Message Date
e7cc1c8ca5 fix: stabilize Docker builds by standardizing on ARM64 and explicit stage naming (klz-2026 pattern)
Some checks failed
Monorepo Pipeline / 🧪 Quality Assurance (push) Successful in 2m42s
Monorepo Pipeline / 🚀 Release (push) Successful in 2m29s
Monorepo Pipeline / 🐳 Build & Push Images (push) Failing after 4m9s
2026-02-04 18:13:54 +01:00
0ccb15a929 refactor: restructure Dockerfile.gatekeeper into base, builder, and runner stages for improved multi-stage build. 2026-02-04 12:10:51 +01:00
4 changed files with 17 additions and 17 deletions

View File

@@ -104,7 +104,8 @@ jobs:
with:
context: .
file: packages/infra/docker/Dockerfile.nextjs
platforms: linux/amd64,linux/arm64
platforms: linux/arm64
pull: true
push: true
secrets: |
NPM_TOKEN=${{ secrets.NPM_TOKEN }}
@@ -117,7 +118,8 @@ jobs:
with:
context: .
file: packages/infra/docker/Dockerfile.runtime
platforms: linux/amd64,linux/arm64
platforms: linux/arm64
pull: true
push: true
secrets: |
NPM_TOKEN=${{ secrets.NPM_TOKEN }}
@@ -130,7 +132,8 @@ jobs:
with:
context: .
file: packages/infra/docker/Dockerfile.gatekeeper
platforms: linux/amd64,linux/arm64
platforms: linux/arm64
pull: true
push: true
secrets: |
NPM_TOKEN=${{ secrets.NPM_TOKEN }}
@@ -143,7 +146,8 @@ jobs:
with:
context: .
file: packages/infra/docker/Dockerfile.directus
platforms: linux/amd64,linux/arm64
platforms: linux/arm64
pull: true
push: true
secrets: |
NPM_TOKEN=${{ secrets.NPM_TOKEN }}

View File

@@ -1,14 +1,10 @@
# Step 1: Builder stage
FROM node:20-alpine AS builder
RUN apk add --no-cache libc6-compat curl
WORKDIR /app
# Enable pnpm
RUN corepack enable pnpm
# Step 2: Install dependencies
# We copy everything first because we have a .dockerignore
# and we need the workspace structure for pnpm to work correctly
# Copy source (honoring .dockerignore)
COPY . .
# Use a secret for NPM_TOKEN to authenticate with private registry
@@ -17,14 +13,12 @@ RUN --mount=type=cache,target=/root/.local/share/pnpm/store/v3 \
export NPM_TOKEN=$(cat /run/secrets/NPM_TOKEN) && \
pnpm i --frozen-lockfile
# Copy source
COPY . .
# Build Gatekeeper
RUN pnpm --filter @mintel/gatekeeper build
# Runner
FROM base AS runner
# Step 2: Runner stage
FROM node:20-alpine AS runner
RUN apk add --no-cache libc6-compat curl
WORKDIR /app
ENV NODE_ENV=production
RUN addgroup --system --gid 1001 nodejs

View File

@@ -1,5 +1,5 @@
# Step 1: Base image
FROM node:20-alpine AS base
# Step 1: Builder image
FROM node:20-alpine AS builder
RUN apk add --no-cache libc6-compat curl
WORKDIR /app
RUN corepack enable pnpm

View File

@@ -194,7 +194,9 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
file: packages/infra/docker/Dockerfile.nextjs
platforms: linux/arm64
pull: true
build-args: |
NEXT_PUBLIC_BASE_URL=${{ needs.prepare.outputs.next_public_base_url }}
NEXT_PUBLIC_TARGET=${{ needs.prepare.outputs.target }}