This commit is contained in:
Parsa Nazer
2025-11-10 14:55:09 +03:30
parent 9ca3532fb6
commit fbe5b38d1d
+7 -15
View File
@@ -1,22 +1,14 @@
# --- Base build + production image ---
FROM node:20-slim AS app
FROM node:20-alpine as build-stage
WORKDIR /app
# Install dependencies needed to build sharp
RUN apt-get update && apt-get install -y \
python3 \
make \
g++ \
&& rm -rf /var/lib/apt/lists/*
# Copy package files and install dependencies
RUN apt-get update && apt-get install -y python3 make g++ git && rm -rf /var/lib/apt/lists/*
COPY package*.json ./
RUN npm install
# Copy project files and build
RUN npm install --force
COPY . .
RUN npm run build
FROM node:20-alpine as production-stage
WORKDIR /app
COPY --from=build-stage /app /app
EXPOSE 3000
ENV NODE_ENV=production
CMD ["npm", "run", "start"]
CMD ["npm", "run", "start"]