chore: align with clean @mintel basis v1.7.10 and modernize deployment
Some checks failed
Some checks failed
This commit is contained in:
23
Dockerfile
23
Dockerfile
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user