Skip to main content
Open console

Go

A compiled Go binary serving its own HTTP

2 min read

A compiled Go binary serving its own HTTP, in place of PHP-FPM and Nginx. The platform's proxy in front of it terminates TLS and routes the hostname.

Your build steps run in the official Go image on Debian trixie. The binary runs in a slim Debian image: deploy steps, cron jobs, workers and vallic ssh have the binary, bash, rsync and CA certificates, and no go. Run what you built (bin/server migrate), not go run. Choose the version with runtime.go in vallic.yaml:

version: 1
type: golang

runtime:
  go: '1.27'

build:
  steps:
    - go build -o bin/server ./cmd/server

start: bin/server
port: 8080

start defaults to bin/server, run in the release at /var/www/html/current (WEB_ROOT), which is read-only. A binary called anything else needs start: a container with nothing to run starts and exits.

Your binary listens on PORT, which is 8080 unless port says otherwise. Go's module and build caches are kept between builds.

Uploads and anything else written at runtime go under /mnt/files (VALLIC_PUBLIC_DIR, VALLIC_PRIVATE_DIR), which outlive the release. See Node.js and Go for a fuller example.

Versions

Version Status
1.27 Supported, and the default
1.26 Supported
1.27.0 Deprecated — still runs, but move to something newer
1.26.7 Deprecated — still runs, but move to something newer
1.26.6 Deprecated — still runs, but move to something newer

A deprecated version still runs and is still what some sites are on. It is listed so you can move before it goes, rather than finding out on the morning a build stops resolving it.

Pin the version, not the build: name 1.27 and the platform matches it to the current build, so a security rebuild reaches you without anybody editing a repository.

What you can change

In vallic.yaml — what each one does is on Service settings:

services:
  - golang:
      version: '1.27'
      environment:
        GOMEMLIMIT: …
        GOMAXPROCS: …

Anything not on this list refuses the deploy, naming the variable — rather than being accepted and quietly ignored.

Need a hand?

Open a ticket from Support in the console. We answer on the ticket.

Open the console How support works