Short Answer
Bun in Docker works well in 2026 โ the official `oven/bun` image is small (~50 MB) and production-ready. Bare metal is faster on cold start but loses the deployment consistency.
Detailed Answer
The official `oven/bun:1` image is roughly 50 MB compressed, starts in well under a second, and handles graceful shutdown signals correctly. For most teams, containerizing Bun is the right call โ you get reproducible builds, easy rollbacks, and the same deployment story as your other services. Bare-metal Bun makes sense only when (1) you have hard microsecond-level cold-start requirements (serverless-like workloads where even a 100 ms container start is too much), or (2) you're running on edge functions that don't take Docker. For a normal REST API, ship the Docker image.
No answers yet
Be the first to answer this question!
Sign in to post an answer