Documentation

Deploy a Go app

Deploy Go web servers, workers and cron jobs on Rebasable with automatic builds.

Rebasable detects Go from go.mod. It downloads modules with a cached build and compiles a static binary. The start command runs that binary.

Example

package main

import (
	"fmt"
	"net/http"
	"os"
)

func main() {
	port := os.Getenv("PORT")
	if port == "" {
		port = "10000"
	}
	http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
		fmt.Fprintln(w, "Hello from Rebasable")
	})
	http.ListenAndServe(":"+port, nil)
}

Settings

Setting Value
Build command go build -o app . (auto-detected)
Start command ./app
Root directory set it when main lives in a subfolder, or build with go build -o app ./cmd/server

The Go version comes from the go directive in go.mod. Private modules need a GOPRIVATE variable and a token in a secret file or env var.