Documentation menu

Deploy Echo on Light Cloud - a compiled Go container on port 8080 with fast cold starts, ideal for scale to zero.

Deploy Echo

Echo is detected from your go.mod and runs as a Go container on port 8080. The generated image compiles the module and ships the binary.

Serve it#

Listen on the routed port - PORT is set to it:

e := echo.New()
e.GET("/", func(c echo.Context) error { return c.String(200, "up") })

port := os.Getenv("PORT")
if port == "" {
    port = "8080"
}
e.Logger.Fatal(e.Start(":" + port)) // binds 0.0.0.0

Configuration and database#

Read environment variables with os.Getenv at startup. DATABASE_URL from the Credentials tab works with pgx, database/sql, and GORM; keep sslmode=require.

Scaling#

Compiled binaries cold-start in well under a second - a natural fit for scale to zero, with concurrency limited mostly by the per-size caps.