Allow native module installs

This commit is contained in:
Parsa Nazer
2025-11-10 21:56:13 +03:30
parent fbe5b38d1d
commit 23968154c9
+12 -8
View File
@@ -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"]