# Production build with simple HTTP server
FROM node:18-alpine

WORKDIR /app

# Copy package files
COPY package*.json ./

# Install dependencies
RUN npm install

# Copy source code
COPY . .

# Build the app
RUN npm run build

# Install serve globally for serving static files
RUN npm install -g serve

# Expose port
EXPOSE 3000

# Serve built files with serve (no host restrictions)
CMD ["serve", "-s", "dist", "-l", "3000"]
