From 75e7c64aabb919ad1f4b3ff3bfc2de773e8b59b0 Mon Sep 17 00:00:00 2001 From: Parsa Nazer Date: Mon, 10 Nov 2025 13:25:54 +0330 Subject: [PATCH] Install sharp dependencies for Linux --- frontend/dockerfile | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/frontend/dockerfile b/frontend/dockerfile index 08b3e15..56b7d8e 100644 --- a/frontend/dockerfile +++ b/frontend/dockerfile @@ -1,20 +1,31 @@ FROM oven/bun:1 AS build-stage WORKDIR /app -# Limit memory for Node processes (3 GB) +# Install sharp dependencies for Linux +RUN apt-get update && apt-get install -y \ + python3 \ + make \ + g++ \ + && rm -rf /var/lib/apt/lists/* COPY package.json bun.lockb* ./ RUN bun install --frozen-lockfile -# --- ✅ Rebuild sharp for correct Linux architecture --- -RUN bun x npm rebuild sharp --platform=linux --arch=x64 --target=$(node -v | sed 's/v//') - COPY . . RUN bun run build FROM oven/bun:1 AS production-stage WORKDIR /app + +# Install sharp dependencies in production stage as well +RUN apt-get update && apt-get install -y \ + python3 \ + make \ + g++ \ + && rm -rf /var/lib/apt/lists/* + COPY --from=build-stage /app /app + EXPOSE 3000 ENV NODE_ENV=production CMD ["bun", "run", "start"] \ No newline at end of file