# Backend Dockerfile - Bun Runtime with Hono Framework # Optimized for production deployment FROM oven/bun:latest as builder # Set working directory WORKDIR /app # Copy backend source code COPY Mode3Test/backend ./backend COPY Mode3Test/package.json . COPY Mode3Test/bunfig.toml . # Install dependencies RUN bun install --production # Build step (if needed) # RUN bun run build # Runtime stage FROM oven/bun:latest WORKDIR /app # Copy from builder COPY --from=builder /app ./ # Set environment variables ENV NODE_ENV=production ENV PORT=3005 ENV LOG_LEVEL=info # Health check HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ CMD bun run --eval "fetch('http://localhost:3005/health').then(r => r.status === 200 ? process.exit(0) : process.exit(1))" || exit 1 # Expose port EXPOSE 3005 # Start application CMD ["bun", "run", "dev"]