Skip to content
Dashboard

Run any Dockerfile on Vercel

Link to headingHow it works

main.go
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.

Dockerfile.vercel
FROM golang:1.24-alpine AS build
WORKDIR /src
COPY . .
RUN go build -o /server main.go
FROM alpine:3.20
COPY --from=build /server /server
CMD ["/server"]

A two-stage build that compiles the binary, then copies it into a minimal Alpine image that runs on boot.

ā–² vercel deploy
Vercel CLI
āœ“ Building image from Dockerfile.vercel
āœ“ Stored image in your project's registry
āœ“ Deployed to Fluid compute
Production: https://my-server.vercel.app

One command builds the image, stores it, and ships it to Fluid compute, then prints the production URL.

Link to headingWhat you get

Link to headingBuilt to start fast

Link to headingWhy now?

Link to headingBackends are back

Ready to deploy?