From 84da0e57e5b80d9d3633bc7744e4399e48b5571e Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Wed, 6 May 2026 17:29:01 +0200 Subject: [PATCH] fix: disable image optimization to fix persistent 400 errors and simplify CI/CD --- Dockerfile | 17 ++++++----------- next.config.mjs | 1 + package.json | 2 +- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6a05562d..ded1121c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -56,16 +56,15 @@ ENV UV_THREADPOOL_SIZE=3 RUN pnpm build # Stage 2: Runner -FROM node:20-slim AS runner +FROM node:20-alpine AS runner WORKDIR /app -# Install curl for health checks and procps -RUN apt-get update && apt-get install -y curl procps && rm -rf /var/lib/apt/lists/* +# Install dependencies for health checks and system compatibility +RUN apk add --no-cache libc6-compat curl # Create nextjs user and group -RUN groupadd --system --gid 1001 nodejs && \ - useradd --system --uid 1001 nextjs && \ - mkdir -p .next/cache/images && \ +RUN addgroup --system --gid 1001 nodejs && \ + adduser --system --uid 1001 nextjs && \ chown -R nextjs:nodejs /app USER nextjs @@ -73,15 +72,11 @@ USER nextjs ENV HOSTNAME="0.0.0.0" ENV PORT=3000 ENV NODE_ENV=production -ENV NEXT_SHARP_PATH=/app/node_modules/sharp # Copy standalone output COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ -# Copy public and static files - standalone expects them in specific locations +# Copy public and static files COPY --from=builder --chown=nextjs:nodejs /app/public ./public COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static -# Ensure cache directory is writable for the nextjs user -# (Already handled by chown -R above, but explicit is better) - CMD ["node", "server.js"] diff --git a/next.config.mjs b/next.config.mjs index 79cc72a6..c0823db2 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -402,6 +402,7 @@ const nextConfig = { ]; }, images: { + unoptimized: true, formats: ['image/webp'], deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048], remotePatterns: [ diff --git a/package.json b/package.json index d0c364e0..d7d6c51f 100644 --- a/package.json +++ b/package.json @@ -113,7 +113,7 @@ "prepare": "husky", "preinstall": "npx only-allow pnpm" }, - "version": "2.3.22-rc.16", + "version": "2.3.22-rc.17", "pnpm": { "onlyBuiltDependencies": [ "@parcel/watcher",