Deploy

Deploy

In production the app is served by the same albedo binary you develop with. There is no Node.js process, no reverse proxy and no separate database server to run beside it.

Package it

albedo ship --target binary   # one self-contained executable
albedo ship --target docker   # a Dockerfile around that executable
albedo ship --target fly      # the files Fly.io needs

The build is the same for every target.

Serve it

albedo serve

Behind a load balancer or in a container, set ALBEDO_PUBLIC_ORIGIN to the address visitors use (https://app.example.com). It is also the base of every link in email.

HTTPS

albedo serve can terminate TLS itself: from a certificate you provide (ALBEDO_TLS_CERT, ALBEDO_TLS_KEY), or from Let's Encrypt with --domain app.example.com, on port 443.

Caution

Rehearse Let's Encrypt with --acme-staging first. Its production service allows only a few certificates per domain per week. Automatic certificates are built and tested, but a first real issuance is still being proven.

Data

The database is the single file forge.db. Put it on persistent storage — ALBEDO_FORGE_DB sets its path — and back it up like any file.

Warning

Run one server process per database. Two processes on the same forge.db each keep their own live view, so a write through one does not reach the pages served by the other. Scale up, not out.

Stopping

On SIGTERM or Ctrl-C the server stops taking new requests and lets in-flight ones, and open live connections, drain before it exits.