From the source
Maybe it's a Go service, a Rails app, a Spring Boot API, or a web server behind nginx.
It speaks HTTP.
It listens on a port.
It just needs somewhere to run.
Add a Dockerfile.vercel file to your project, and Vercel builds, stores, deploys, and autoscales the image on Fluid compute , so you pay only for the CPU your code uses.
No daemon to run locally, registry to set up, or cluster to babysit.
Copy link to heading How it works Here is a small HTTP server in Go, listening on $PORT : package main import ( "fmt" "net/http" "os" ) func main ( ) { port := os .
Getenv ( "PORT" ) if port == "" { port = "80" } http .
HandleFunc ( "/" , func ( w http .
ResponseWriter , r * http .
Request ) { fmt .
Fprintln ( w , "Hello from a container on Vercel 👋" ) } ) http .
ListenAndServe ( ":" + port , nil ) } A minimal HTTP server that reads its port from $PORT and answers every request.
Add a Dockerfile.vercel file that builds it into a small image and runs it: FROM golang:1.26-alpine AS build WORKDIR /src COPY . .
RUN go build -o /server main.go FROM alpine:3.22 COPY --from = build /server /server CMD [ "/server" ] …






