# Build stage FROM node:20-alpine AS builder WORKDIR /app # Copy package files COPY package*.json bun.lock* ./ # Install dependencies (try bun first, fallback to npm) RUN if [ -f bun.lock ]; then \ npm install -g bun && bun install; \ else npm ci; \ fi # Copy source code COPY . . # Build the application RUN if [ -f bun.lock ]; then \ bun run build; \ else npm run build; \ fi # Production stage FROM nginx:alpine # Copy built files from builder stage COPY --from=builder /app/build /usr/share/nginx/html # Copy nginx configuration COPY nginx.conf /etc/nginx/nginx.conf # Expose port 80 EXPOSE 80 # Start nginx CMD ["nginx", "-g", "daemon off;"]