# Build stage
FROM node:20-alpine

WORKDIR /app

# Copy dependencies
COPY package.json package-lock.json* ./

RUN npm ci --legacy-peer-deps

# Copy all source
COPY . .

# Set production env (agar .env.production bo‘lsa ishlaydi)
ENV NODE_ENV=production

# Build for production
RUN npm run build
ENTRYPOINT npm run preview

