chore: use standardized @mintel base images and sync packages
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 5s
Build & Deploy / 🏗️ Build (push) Failing after 20s
Build & Deploy / 🧪 QA (push) Successful in 4m12s
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🩺 Health Check (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 5s
Build & Deploy / 🏗️ Build (push) Failing after 20s
Build & Deploy / 🧪 QA (push) Successful in 4m12s
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🩺 Health Check (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s
This commit is contained in:
51
Dockerfile
51
Dockerfile
@@ -1,13 +1,7 @@
|
|||||||
# Stage 1: Builder
|
# Stage 1: Builder
|
||||||
FROM node:20-alpine AS builder
|
FROM registry.infra.mintel.me/mintel/nextjs:latest AS builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install system dependencies
|
|
||||||
RUN apk add --no-cache libc6-compat curl
|
|
||||||
|
|
||||||
# Clean the workspace in case the base image is dirty
|
|
||||||
RUN rm -rf ./*
|
|
||||||
|
|
||||||
# Arguments for build-time configuration
|
# Arguments for build-time configuration
|
||||||
ARG NEXT_PUBLIC_BASE_URL
|
ARG NEXT_PUBLIC_BASE_URL
|
||||||
ARG NEXT_PUBLIC_TARGET
|
ARG NEXT_PUBLIC_TARGET
|
||||||
@@ -23,23 +17,18 @@ ENV UMAMI_API_ENDPOINT=$UMAMI_API_ENDPOINT
|
|||||||
ENV SKIP_RUNTIME_ENV_VALIDATION=true
|
ENV SKIP_RUNTIME_ENV_VALIDATION=true
|
||||||
ENV CI=true
|
ENV CI=true
|
||||||
|
|
||||||
# Set pnpm home and store directory for caching
|
# Copy manifest files specifically for better layer caching
|
||||||
ENV PNPM_HOME="/pnpm"
|
COPY pnpm-lock.yaml package.json .npmrc* ./
|
||||||
ENV PATH="$PNPM_HOME:$PATH"
|
|
||||||
RUN mkdir -p /pnpm/store
|
|
||||||
|
|
||||||
# Enable pnpm
|
|
||||||
RUN corepack enable
|
|
||||||
|
|
||||||
# Copy workspace files for dependency installation
|
|
||||||
COPY pnpm-lock.yaml pnpm-workspace.yaml package.json .npmrc* ./
|
|
||||||
COPY apps/web/package.json ./apps/web/package.json
|
COPY apps/web/package.json ./apps/web/package.json
|
||||||
|
|
||||||
# Install dependencies with cache mount
|
# Install dependencies with cache mount and dynamic .npmrc (High Fidelity pattern)
|
||||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
|
||||||
--mount=type=secret,id=NPM_TOKEN \
|
--mount=type=secret,id=NPM_TOKEN \
|
||||||
export NPM_TOKEN=$(cat /run/secrets/NPM_TOKEN 2>/dev/null || echo $NPM_TOKEN) && \
|
export NPM_TOKEN=$(cat /run/secrets/NPM_TOKEN 2>/dev/null || echo $NPM_TOKEN) && \
|
||||||
pnpm install --frozen-lockfile
|
echo "@mintel:registry=https://npm.infra.mintel.me" > .npmrc && \
|
||||||
|
echo "//npm.infra.mintel.me/:_authToken=\${NPM_TOKEN}" >> .npmrc && \
|
||||||
|
pnpm install --frozen-lockfile && \
|
||||||
|
rm .npmrc
|
||||||
|
|
||||||
# Copy source code
|
# Copy source code
|
||||||
COPY . .
|
COPY . .
|
||||||
@@ -48,27 +37,15 @@ COPY . .
|
|||||||
RUN pnpm --filter @mintel/web build
|
RUN pnpm --filter @mintel/web build
|
||||||
|
|
||||||
# Stage 2: Runner
|
# Stage 2: Runner
|
||||||
FROM node:20-alpine AS runner
|
FROM registry.infra.mintel.me/mintel/runtime:latest AS runner
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install system dependencies
|
|
||||||
RUN apk add --no-cache libc6-compat curl
|
|
||||||
|
|
||||||
ENV HOSTNAME="0.0.0.0"
|
|
||||||
ENV PORT=3000
|
|
||||||
ENV NODE_ENV=production
|
|
||||||
|
|
||||||
# Create non-root user for security
|
|
||||||
RUN addgroup --system --gid 1001 nodejs && \
|
|
||||||
adduser --system --uid 1001 nextjs
|
|
||||||
|
|
||||||
# Copy standalone output and static files (Monorepo paths)
|
# Copy standalone output and static files (Monorepo paths)
|
||||||
COPY --from=builder --chown=nextjs:nodejs /app/apps/web/public ./apps/web/public
|
# Note: Base image already handles the non-root user and basic env
|
||||||
COPY --from=builder --chown=nextjs:nodejs /app/apps/web/.next/standalone ./
|
COPY --from=builder /app/apps/web/public ./apps/web/public
|
||||||
COPY --from=builder --chown=nextjs:nodejs /app/apps/web/.next/static ./apps/web/.next/static
|
COPY --from=builder /app/apps/web/.next/standalone ./
|
||||||
COPY --from=builder --chown=nextjs:nodejs /app/apps/web/.next/cache ./apps/web/.next/cache
|
COPY --from=builder /app/apps/web/.next/static ./apps/web/.next/static
|
||||||
|
COPY --from=builder /app/apps/web/.next/cache ./apps/web/.next/cache
|
||||||
USER nextjs
|
|
||||||
|
|
||||||
# Start from the app directory to ensure references solve correctly
|
# Start from the app directory to ensure references solve correctly
|
||||||
WORKDIR /app/apps/web
|
WORKDIR /app/apps/web
|
||||||
|
|||||||
@@ -77,12 +77,12 @@
|
|||||||
"@eslint/eslintrc": "^3.3.3",
|
"@eslint/eslintrc": "^3.3.3",
|
||||||
"@eslint/js": "^10.0.0",
|
"@eslint/js": "^10.0.0",
|
||||||
"@lhci/cli": "^0.15.1",
|
"@lhci/cli": "^0.15.1",
|
||||||
"@mintel/cli": "^1.6.0",
|
"@mintel/cli": "^1.7.3",
|
||||||
"@mintel/eslint-config": "^1.6.0",
|
"@mintel/eslint-config": "^1.7.3",
|
||||||
"@mintel/husky-config": "^1.6.0",
|
"@mintel/husky-config": "^1.7.3",
|
||||||
"@mintel/next-config": "^1.6.0",
|
"@mintel/next-config": "^1.7.3",
|
||||||
"@mintel/next-utils": "^1.7.15",
|
"@mintel/next-utils": "^1.7.15",
|
||||||
"@mintel/tsconfig": "^1.6.0",
|
"@mintel/tsconfig": "^1.7.3",
|
||||||
"@next/eslint-plugin-next": "^16.1.6",
|
"@next/eslint-plugin-next": "^16.1.6",
|
||||||
"@tailwindcss/typography": "^0.5.15",
|
"@tailwindcss/typography": "^0.5.15",
|
||||||
"@types/node": "^25.0.6",
|
"@types/node": "^25.0.6",
|
||||||
|
|||||||
12
package.json
12
package.json
@@ -13,12 +13,12 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/eslintrc": "^3.3.3",
|
"@eslint/eslintrc": "^3.3.3",
|
||||||
"@eslint/js": "^10.0.0",
|
"@eslint/js": "^10.0.0",
|
||||||
"@mintel/cli": "^1.6.0",
|
"@mintel/cli": "^1.7.3",
|
||||||
"@mintel/eslint-config": "^1.6.0",
|
"@mintel/eslint-config": "^1.7.3",
|
||||||
"@mintel/husky-config": "^1.6.0",
|
"@mintel/husky-config": "^1.7.3",
|
||||||
"@mintel/next-config": "^1.6.0",
|
"@mintel/next-config": "^1.7.3",
|
||||||
"@mintel/next-utils": "^1.6.0",
|
"@mintel/next-utils": "^1.7.15",
|
||||||
"@mintel/tsconfig": "^1.6.0",
|
"@mintel/tsconfig": "^1.7.3",
|
||||||
"@next/eslint-plugin-next": "^16.1.6",
|
"@next/eslint-plugin-next": "^16.1.6",
|
||||||
"eslint": "10.0.0",
|
"eslint": "10.0.0",
|
||||||
"eslint-plugin-react": "^7.37.5",
|
"eslint-plugin-react": "^7.37.5",
|
||||||
|
|||||||
597
pnpm-lock.yaml
generated
597
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user