# Build stage FROM oven/bun:1 AS builder WORKDIR /build # Copy package files COPY package.json bun.lock ./ RUN bun install --frozen-lockfile # Copy source code COPY . . # Build the application RUN bun run build # Runtime stage - serve with nginx FROM nginx:alpine # Copy built files COPY --from=builder /build/dist /usr/share/nginx/html # Copy nginx configuration COPY nginx.conf /etc/nginx/conf.d/default.conf # Expose port EXPOSE 80 # Health check HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ CMD wget --no-verbose --tries=1 --spider http://localhost/health || exit 1 CMD ["nginx", "-g", "daemon off;"]