# Build stage
FROM node:25-alpine3.22 AS builder

# Set workdir
WORKDIR /build

# Install deps
COPY package.json package-lock.json* ./
RUN npm install

# Copy source code
COPY . .
RUN npm run build

# Runtime stage
FROM node:25-alpine3.22

# Copy built application from builder stage
WORKDIR /app
RUN npm install -g serve
COPY --from=builder /build/dist ./dist

# Start the application
CMD ["serve", "-s", "dist", "-l", "3000"]
