Files
hossein-por-shop/frontend/dockerfile
T
Parsa Nazer 8453a4e400 npm only
2025-11-10 13:36:36 +03:30

25 lines
496 B
Docker

# --- Base build + production image ---
FROM node:20-slim AS app
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
COPY package*.json ./
RUN npm ci --omit=dev
# Copy project files and build
COPY . .
RUN npm run build
# Expose port and set env vars
EXPOSE 3000
ENV NODE_ENV=production
# Start the app
CMD ["npm", "run", "start"]