Files
Patryk-KuchtaandClaude Opus 5 ab7b2fa6f4
Security Audit / Security Vulnerability Scan (pull_request) Failing after 13s
Code Quality Check / Lint & Type Check (pull_request) Failing after 13s
fix: upgrade Node to 24 so the Docker build works with sharp 0.35
sharp 0.35.5 requires Node >=20.9.0, so the node:18-alpine image failed
to load the linuxmusl-arm64 binary and the production build broke.

Move the image and both CI workflows to Node 24 (current Active LTS),
raise the engines floor to the version sharp actually needs, and declare
packageManager to silence the corepack warning.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-10-19 19:37:21 +01:00

47 lines
883 B
Docker

FROM node:24-alpine AS base
RUN apk add --no-cache libc6-compat
RUN corepack enable && corepack prepare [email protected] --activate
WORKDIR /app
FROM base AS deps
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile --prod=false
FROM base AS builder
COPY --from=deps /app/node_modules ./node_modules
COPY . .
ENV NEXT_TELEMETRY_DISABLED=1
ENV NODE_ENV=production
RUN pnpm run build
FROM base AS runner
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
COPY --from=builder /app/public ./public
RUN mkdir .next
RUN chown nextjs:nodejs .next
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
USER nextjs
EXPOSE 4000
ENV PORT=4000
ENV HOSTNAME="0.0.0.0"
CMD ["node", "server.js"]