From 5c791164a3282afaece347019948cf18979c117e Mon Sep 17 00:00:00 2001 From: Sean O'Connor Date: Thu, 10 Sep 2026 12:08:16 -0400 Subject: [PATCH] Include Sharp native libraries and verify final image conversion --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 02610b0..a636deb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,10 +22,13 @@ FROM oven/bun:1.4.0 AS web WORKDIR /app ENV NODE_ENV=production HOSTNAME=0.0.0.0 PORT=3000 NEXT_TELEMETRY_DISABLED=1 COPY --from=builder --chown=bun:bun /app/apps/web/.next/standalone ./ +# Next's standalone trace can omit libvips shared libraries loaded by Sharp. +COPY --from=builder --chown=bun:bun /app/node_modules/@img ./node_modules/@img COPY --from=builder --chown=bun:bun /app/apps/web/.next/static ./apps/web/.next/static COPY --from=builder --chown=bun:bun /app/apps/web/public ./apps/web/public COPY --from=builder --chown=bun:bun /app/scripts/check-production-env.ts ./scripts/check-production-env.ts USER bun +RUN cd /app/apps/web && bun -e 'import sharp from "sharp"; const image = await sharp({create:{width:8,height:8,channels:3,background:"white"}}).webp().toBuffer(); if (!image.length) throw new Error("Sharp runtime smoke test failed");' EXPOSE 3000 CMD ["sh", "-c", "bun scripts/check-production-env.ts && exec bun apps/web/server.js"]