Menu

Run any Dockerfile on Vercel
πŸ“°

Run any Dockerfile on Vercel

Vercel NewsΒ·Malte UblΒ·5 days ago
#VzCKVs9d
#vercel#server#container#port#article
Reading 0:00
15s threshold

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 .…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.