Allow native module installs
This commit is contained in:
+12
-8
@@ -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"]
|
||||
Reference in New Issue
Block a user