From 23968154c96675da394fcf8014ce370541f98eeb Mon Sep 17 00:00:00 2001 From: Parsa Nazer Date: Mon, 10 Nov 2025 21:56:13 +0330 Subject: [PATCH] Allow native module installs --- frontend/dockerfile | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/frontend/dockerfile b/frontend/dockerfile index 912161e..16d9c93 100644 --- a/frontend/dockerfile +++ b/frontend/dockerfile @@ -1,14 +1,18 @@ -FROM node:20-alpine as build-stage +FROM oven/bun:1 AS build-stage WORKDIR /app -RUN apt-get update && apt-get install -y python3 make g++ git && rm -rf /var/lib/apt/lists/* -COPY package*.json ./ -RUN npm install --force -COPY . . -RUN npm run build -FROM node:20-alpine as production-stage +# Allow native module installs (sharp needs this) +ENV BUN_CONFIG_NO_NATIVE_INSTALLS=0 + +COPY package.json bun.lockb* ./ +RUN bun install --frozen-lockfile && bun add sharp --platform=linux --arch=x64 + +COPY . . +RUN bun run build + +FROM oven/bun:1 AS production-stage WORKDIR /app COPY --from=build-stage /app /app EXPOSE 3000 ENV NODE_ENV=production -CMD ["npm", "run", "start"] +CMD ["bun", "run", "start"] \ No newline at end of file