chore: align with clean @mintel basis v1.7.10 and modernize deployment
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 10s
Build & Deploy / 🧪 QA (push) Failing after 14s
Build & Deploy / 🏗️ Build (push) Has been skipped
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s

This commit is contained in:
2026-02-11 17:49:15 +01:00
parent 406cf22050
commit 8a9cd7ef3e
3 changed files with 16 additions and 22 deletions

View File

@@ -1,10 +1,7 @@
# Stage 1: Builder
FROM node:20-alpine AS builder
FROM registry.infra.mintel.me/mintel/nextjs:1.7.10 AS builder
WORKDIR /app
# Clean the workspace
RUN rm -rf ./*
# Arguments for build-time configuration
ARG NEXT_PUBLIC_BASE_URL
ARG NEXT_PUBLIC_TARGET
@@ -18,9 +15,6 @@ ENV DIRECTUS_URL=$DIRECTUS_URL
ENV SKIP_RUNTIME_ENV_VALIDATION=true
ENV CI=true
# Enable pnpm v10
RUN corepack enable && corepack prepare pnpm@10.3.0 --activate
# Copy lockfile and manifest for dependency installation caching
COPY pnpm-lock.yaml package.json .npmrc* ./
@@ -40,16 +34,13 @@ COPY . .
RUN pnpm build
# Stage 2: Runner
FROM node:20-alpine AS runner
FROM registry.infra.mintel.me/mintel/runtime:1.7.10 AS runner
WORKDIR /app
# Install curl for health checks
RUN apk add --no-cache curl
# Create nextjs user and group
RUN addgroup --system --gid 1001 nodejs && \
adduser --system --uid 1001 nextjs && \
chown nextjs:nodejs /app
# Create nextjs user and group (standardized in runtime image but ensuring local ownership)
USER root
RUN chown -R nextjs:nodejs /app
USER nextjs
ENV HOSTNAME="0.0.0.0"
ENV PORT=3000
@@ -61,6 +52,4 @@ COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
COPY --from=builder --chown=nextjs:nodejs /app/.next/cache ./.next/cache
USER nextjs
CMD ["node", "server.js"]