KamuiDash KamuiDash Docs
EN JA

Go

Deploy a Go application with a separate DB initializer binary.

Assumed Structure

  • App server: go/main.go → built to out/app
  • DB initializer: cmd/db/main.go → built to out/db
  • Setup builds both binaries; pre-deploy runs out/db to initialize the schema; start command launches the server

Deploy Commands

Field Value (example)
Setup Command go build -trimpath -ldflags='-s -w' -o out/app ./go;go build -trimpath -ldflags='-s -w' -o out/db ./cmd/db
Pre-deploy Command out/db
Start Command out/app

All commands run from the repository root.

Environment Variables

The PORT environment variable is set by default. Your app should use this value as the listen port.

When a database is selected during app creation, the following variables are also automatically set:

  • DB_HOST, DB_PORT, DB_NAME, DB_USER, DB_PASSWORD
  • DATABASE_URL — full connection string

Starter App

See the starter app for reference: kamui-project/go-starter

Next Steps