Deploy Fiber on Light Cloud - a compiled Go container on port 8080 with fast cold starts, ideal for scale to zero.
Deploy Fiber
Fiber 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:
app := fiber.New()
app.Get("/", func(c *fiber.Ctx) error { return c.SendString("up") })
port := os.Getenv("PORT")
if port == "" {
port = "8080"
}
log.Fatal(app.Listen(":" + 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. Fiber's fasthttp core thrives at high concurrency; the per-size caps are the practical limit.