Live server apps

How a server app in any language is built, started from its Procfile, sized, health-checked, released with no gap, and rolled back.

oalo deploy --app api --env prod (or Launch in the dashboard) puts one commit of a server app live. Oalo:

  1. Builds an image of that commit, away from your workspace (see "How the image is built" below).
  2. Runs the Procfile's release line once, if there is one (migrations, say). If it fails, nothing changes: the live app stays as it was.
  3. Starts every Procfile process in its own container: web, which must listen on $PORT, and each other line as a worker. With no Procfile, web is the language's usual start (npm start for Node).
  4. Waits for web to answer HTTP on $PORT, up to a minute, while the previous release keeps serving. Then the live address moves to the new one and the old containers stop. If the new one crashes or never answers, it's removed and the old one keeps serving; the deploy reports its last log lines.

Every release is kept by commit (oalo deploy --history), and oalo deploy --rollback makes an earlier one live again. It is built again (an identical earlier build is reused when nothing it depends on changed), with today's variables, and swaps over once it answers, like any live deploy. Rolling back again goes further back; it never returns to a release you rolled back from.

A live process that crashes later is restarted on its own. oalo logs --env prod keeps showing its output across restarts (with a line saying it exited), and oalo apps names a process that isn't running.

A new release that breaks goes back on its own. In its first 15 minutes live, a release that stops answering for 3 checks in a row, or restarts 3 times, is rolled back to the release before it (the one oalo deploy --rollback would pick), and everyone on the workspace is told: when it starts and when the earlier release is live again. Each release is rolled back once at most, and a release that was itself an automatic rollback never is, so it can't loop. Fix it and deploy again. To turn it off for an app, add "auto_rollback": false to .oalo/app.json.

The preview (oalo deploy, dev) runs the Procfile's release line too, before it restarts, so it starts on its schema. If the preview doesn't answer, or release fails, the deploy says so and exits 1; your code is saved either way.

How the image is built

The first of these that fits the commit:

  1. The repo's own Dockerfile, at its root. Any language or stack.
  2. Oalo's Dockerfile for the runtime, when the repo has none: Bun (bun.lock or bun.lockb), Elixir, Phoenix or Plug (mix.exs), Rust (Cargo.toml), Deno (deno.json), or a Dart server, Shelf or Dart Frog (pubspec.yaml, compiled to one native binary). You don't need to know Docker. oalo dockerfile prints the one used, and oalo dockerfile --write saves it as ./Dockerfile to change; once committed, the repo's copy is used.
  3. Buildpacks, found from the repo: Node (package.json), Python (requirements.txt or pyproject.toml), Ruby (Gemfile), Go (go.mod), Java, Kotlin or Scala (pom.xml, Gradle or build.sbt), PHP (composer.json) or .NET (a project file). A Node app needs its lockfile committed (package-lock.json, yarn.lock or pnpm-lock.yaml); the build says so if it's missing.

The deploy's log says which one it used.

Previews by language

Every language above goes live, and every one has a preview (dev-<app>, after a plain oalo deploy): the app's dev server in that language's toolchain, restarted on each deploy. Without a Procfile web: line it starts the usual way:

LanguageInstallStart
Node, Bunthe repo's package managerdev (else start) script, or the entry file
Pythonpip into .venvuvicorn (main.py), Flask (app.py), Django (manage.py)
Gogo mod downloadgo run .
Rubybundle installrails server, rackup (config.ru), or ruby app.rb
PHPcomposer installphp artisan serve, or php -S on public/ or the root
Java, Kotlin, Scalafetched as it startsSpring Boot (Maven or Gradle, the repo's wrapper first), Gradle run, or sbt run
.NETdotnet restoredotnet run
Elixirmix deps.getmix phx.server, or mix run --no-halt
Rustcargo fetchcargo run
Dartdart pub geta Dart Frog app built and its server run, or dart run bin/server.dart
Denodeno installthe dev or start task, or main.ts (watched)
  • Listen on 0.0.0.0 and $PORT. The preview runs in a container, so a server bound to 127.0.0.1 can't be reached. Spring Boot gets SERVER_PORT and ASP.NET Core ASPNETCORE_URLS set for it; a Phoenix app needs ip: {0, 0, 0, 0} in its dev config's endpoint http.
  • Package caches last between previews, per app.
  • An app built only from a Dockerfile (no language Oalo recognizes) has no preview: oalo deploy --env prod builds and runs it live.

A server language's own file decides what kind of app a repo is, even with a package.json beside it for assets (Rails, Laravel, Phoenix). An app imported before Oalo knew its language (shown as code only) becomes a server app on its next oalo deploy.

What an image must do

Whatever builds it, the image runs the same way:

  • It serves HTTP on $PORT. Read the port from the environment.
  • It runs as uid 1000, with a read-only filesystem. /tmp is writable; keep anything that must last in the database.
  • It's built for arm64. Most base images have an arm64 version (all the official ones do).
  • No privileges: no Docker inside it, no host folders, no root-only system calls.

With a Dockerfile, the Procfile still names the processes. web runs the image's own ENTRYPOINT and CMD, or the Procfile's web: line when there is one; each other line (a worker, release) runs through /bin/sh. The app's public prod variables reach the build as build arguments (ARG NAME); secrets never do.

A Phoenix app also needs SECRET_KEY_BASE: run mix phx.gen.secret, then oalo env set SECRET_KEY_BASE --secret --env prod.

Sizes

Each process gets a size from .oalo/app.json, committed in the repo. The same file names the variables the app needs and a health path:

{
  "sizes":  { "web": "small", "worker": "medium" },
  "health": "/healthz",
  "env":    { "required": ["STRIPE_KEY"], "optional": ["SENTRY_DSN"] }
}
  • sizes: per Procfile process, for the live app.
  • health: a path on web that answers 2xx or 3xx once the app is ready. A release goes live only when it does. Without it, any HTTP answer on / is enough, whatever its status.
  • env.required: a live deploy is refused until each is set for prod (oalo env set NAME --env prod); a dev deploy names the ones dev lacks.
  • tools (endpoints a bot can call) are in the same file: see app tools.

Every key is optional, and a key Oalo doesn't read is refused, so a typo can't pass for a setting.

SizeCPUsMemory
tiny0.25512 MB
small (the default)0.51 GB
medium12 GB
large24 GB

Memory is a hard limit: a process that goes over it is restarted. The sizes come from the commit being launched, so a rollback brings its own back. All apps on a workspace share a set part of its capacity, and a launch that wouldn't fit is refused with a reason. Bigger sizes (xlarge, 2xlarge) and more than one copy of a process aren't available yet.

These sizes are for the live app. A preview's size comes from its language (medium for JVM, .NET and Rust, small for the rest).

Uptime and incidents

Oalo checks each live app every minute. For a server app: whether its web process answers HTTP on its port (or answers .oalo/app.json's health path with a 2xx or 3xx, when it names one), and how often each process was restarted. For a web app served as files (React, Flutter, Expo or Figma builds): whether its live build is there to serve, with its index.html.

  • An incident opens when the app hasn't answered for 3 checks in a row ("isn't answering"), or its processes restarted 3 times in 10 minutes ("keeps restarting", even if it answers in between). It closes after 2 good checks in a row and 10 minutes without a restart.
  • It says what was seen, not a guess: which process, how many restarts, the exit code, the log's last lines, and a memory kill with the size it had and the fix (a bigger size in .oalo/app.json).
  • Everyone on the workspace is told when one opens and when the app is back: in the dashboard's bell, and by email even while they're on the dashboard. Each person can turn either off under Notifications.
  • oalo incidents --app api lists them; oalo apps marks an app with one open; the app's Logs tab in the dashboard shows them.

What the app gets

  • Variables: every prod variable set with oalo env, secrets included, when its containers start, plus PORT, DATABASE_URL (a login every server app in the workspace shares, through the connection pooler: see the app's database), APP_SCHEMA=prod, OALO_ENV=prod, and OALO_URL and OALO_SYNC_TOKEN for calling Oalo. The build sees only the public ones. See App environment variables.
  • Network: the internet, and its database. Oalo's API is reached at OALO_URL like any public address; the workspace's internal services and other apps' containers are not reachable.
  • Paths: every path on the app's address is the app's (/api, /live, /checkout and the rest), except two Oalo keeps: anything under /_oalo/ and POST /chat/bootstrap (the chat widget's start).
  • What it can use from Oalo: events into workflows (App events), workflows as functions (Calling a workflow), its endpoints as bot tools (App tools) and a chat widget signed in as its users (Chat widget).
  • Disk: the image is read-only; write temporary files under /tmp. Keep anything that must last in the database.
  • Logs: oalo logs --app api --env prod, per process.
Related
Try it on your own Base

Sign up, install the CLI, and deploy your repo in a few minutes.

bring your repo