Run any Dockerfile on Vercel
By Steven Van ·
The beta feature builds, stores, and autoscales any OCI image from a Dockerfile.vercel file, billed only for active CPU time.
Vercel Functions can now run any container image built from a Dockerfile, not just its supported frameworks. Add a Dockerfile.vercel (or Containerfile.vercel) file to a project's root and Vercel builds the image, stores it in Vercel Container Registry, and deploys it on Fluid compute, scaling automatically and billing only for CPU that's actively running.
The only requirement is that the server listens on $PORT, which defaults to 80 and can be overridden with a PORT environment variable. That covers Go, Rails, Spring Boot, Express, Laravel, ASP.NET, FastAPI, PHP, or a web server behind nginx. Deploys work like any other Vercel project: a git push rebuilds the image and hands back a preview URL, or running vercel deploys without committing.
- A services configuration in vercel.json can route traffic to multiple containerized apps within a single project.
- Idle functions scale down after 5 minutes in production or 30 seconds in preview, receiving a SIGTERM with a 30-second grace period first.
- Secure Compute and Static IPs are not yet supported for custom container images.
The feature, called Container Images, is in beta on all plans.