You have a server in a container. 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 .β¦