update dockerfile

This commit is contained in:
Parsa Nazer
2025-11-10 22:12:51 +03:30
parent 6441b8be8b
commit bedb1b482e
+5 -8
View File
@@ -1,17 +1,14 @@
# Build stage — use Node to correctly install native deps
FROM node:22-alpine AS build-stage
FROM node:20-alpine as build-stage
WORKDIR /app
COPY package*.json ./
RUN npm ci --os=linux --cpu=x64
RUN npm install --ignore-scripts=false --force
COPY . .
RUN npm run build
# Run stage — use Bun for serving
FROM oven/bun:1 AS production-stage
FROM node:20-alpine as production-stage
WORKDIR /app
RUN npm rebuild --verbose sharp
COPY --from=build-stage /app /app
EXPOSE 3000
ENV NODE_ENV=production
CMD ["bun", "run", "start"]
CMD ["npm", "run", "start"]