A Dokku CHECKS file for zero-downtime deploys
Dokku swaps to a new container before it is actually ready, so requests hit a half-booted app. A CHECKS file makes Dokku wait for a real healthcheck to pass.
26 Jun 2026
Drop a file named CHECKS at the root of your build context (next to the Dockerfile). Dokku reads it during deploy and only routes traffic once the path returns 200.
# CHECKS
# wait this many seconds before the first attempt
WAIT=5
# seconds between attempts
TIMEOUT=10
# number of attempts before the deploy is failed
ATTEMPTS=6
# path expected-substring-in-the-body
/healthz okPair it with an app endpoint that checks its own dependencies, not just that the process is up:
// in your Express app
app.get("/healthz", async (_req, res) => {
try {
await db.query("select 1");
res.status(200).send("ok");
} catch {
res.status(503).send("db down");
}
});Gotchas
The check runs against the new container on its internal port, before the proxy switches over. If /healthz touches the database and the database is unreachable, the deploy fails and Dokku keeps the old container serving traffic, which is what you want. Keep the check cheap: it runs up to ATTEMPTS times on every single deploy.
- Wrap a CLI as an MCP tool when there is no APIThe thing you want an agent to drive only has a CLI. execFile it, hand back stdout, and put bounds on the call so it cannot eat your process.Snippet
- Set a GitHub Actions secret the right wayYou cannot POST a plaintext Actions secret. You fetch the repo public key, seal the value with libsodium, then PUT the ciphertext.Snippet
- mcp-dokkuAn MCP server that drives a Dokku PaaS over SSH.Tool
- Guardrails for agents in productionA catalogue of the guards I actually ship: typed confirmations, blast-radius escalation, pay-to-play gating, ordered workflows, and read-only by default.Musing
- mcp-search-consoleAn MCP server for Google Search Console properties, sitemaps, and analytics.Tool