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