fix: stabilize Docker builds by standardizing on ARM64 and explicit stage naming (klz-2026 pattern)
This commit is contained in:
@@ -104,7 +104,8 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: packages/infra/docker/Dockerfile.nextjs
|
file: packages/infra/docker/Dockerfile.nextjs
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/arm64
|
||||||
|
pull: true
|
||||||
push: true
|
push: true
|
||||||
secrets: |
|
secrets: |
|
||||||
NPM_TOKEN=${{ secrets.NPM_TOKEN }}
|
NPM_TOKEN=${{ secrets.NPM_TOKEN }}
|
||||||
@@ -117,7 +118,8 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: packages/infra/docker/Dockerfile.runtime
|
file: packages/infra/docker/Dockerfile.runtime
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/arm64
|
||||||
|
pull: true
|
||||||
push: true
|
push: true
|
||||||
secrets: |
|
secrets: |
|
||||||
NPM_TOKEN=${{ secrets.NPM_TOKEN }}
|
NPM_TOKEN=${{ secrets.NPM_TOKEN }}
|
||||||
@@ -130,7 +132,8 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: packages/infra/docker/Dockerfile.gatekeeper
|
file: packages/infra/docker/Dockerfile.gatekeeper
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/arm64
|
||||||
|
pull: true
|
||||||
push: true
|
push: true
|
||||||
secrets: |
|
secrets: |
|
||||||
NPM_TOKEN=${{ secrets.NPM_TOKEN }}
|
NPM_TOKEN=${{ secrets.NPM_TOKEN }}
|
||||||
@@ -143,7 +146,8 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: packages/infra/docker/Dockerfile.directus
|
file: packages/infra/docker/Dockerfile.directus
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/arm64
|
||||||
|
pull: true
|
||||||
push: true
|
push: true
|
||||||
secrets: |
|
secrets: |
|
||||||
NPM_TOKEN=${{ secrets.NPM_TOKEN }}
|
NPM_TOKEN=${{ secrets.NPM_TOKEN }}
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
FROM node:20-alpine AS base
|
# Step 1: Builder stage
|
||||||
|
FROM node:20-alpine AS builder
|
||||||
RUN apk add --no-cache libc6-compat curl
|
RUN apk add --no-cache libc6-compat curl
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN corepack enable pnpm
|
RUN corepack enable pnpm
|
||||||
|
|
||||||
# Step 2: Builder stage
|
|
||||||
FROM base AS builder
|
|
||||||
# Copy source (honoring .dockerignore)
|
# Copy source (honoring .dockerignore)
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
@@ -17,8 +16,9 @@ RUN --mount=type=cache,target=/root/.local/share/pnpm/store/v3 \
|
|||||||
# Build Gatekeeper
|
# Build Gatekeeper
|
||||||
RUN pnpm --filter @mintel/gatekeeper build
|
RUN pnpm --filter @mintel/gatekeeper build
|
||||||
|
|
||||||
# Step 3: Runner stage
|
# Step 2: Runner stage
|
||||||
FROM base AS runner
|
FROM node:20-alpine AS runner
|
||||||
|
RUN apk add --no-cache libc6-compat curl
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
RUN addgroup --system --gid 1001 nodejs
|
RUN addgroup --system --gid 1001 nodejs
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Step 1: Base image
|
# Step 1: Builder image
|
||||||
FROM node:20-alpine AS base
|
FROM node:20-alpine AS builder
|
||||||
RUN apk add --no-cache libc6-compat curl
|
RUN apk add --no-cache libc6-compat curl
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN corepack enable pnpm
|
RUN corepack enable pnpm
|
||||||
|
|||||||
@@ -194,7 +194,9 @@ jobs:
|
|||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
|
file: packages/infra/docker/Dockerfile.nextjs
|
||||||
platforms: linux/arm64
|
platforms: linux/arm64
|
||||||
|
pull: true
|
||||||
build-args: |
|
build-args: |
|
||||||
NEXT_PUBLIC_BASE_URL=${{ needs.prepare.outputs.next_public_base_url }}
|
NEXT_PUBLIC_BASE_URL=${{ needs.prepare.outputs.next_public_base_url }}
|
||||||
NEXT_PUBLIC_TARGET=${{ needs.prepare.outputs.target }}
|
NEXT_PUBLIC_TARGET=${{ needs.prepare.outputs.target }}
|
||||||
|
|||||||
Reference in New Issue
Block a user