Skip to main content

Self-host preflight

Before you start the first assessment on a new or changed deployment, run the API preflight diagnostic. It checks the dependencies that the normal readiness probe does not: the database, the job queue, object storage, the feature flag service, the connection to the analysis engine, billing when it is configured, and the secrets the API needs at startup.

docker compose run --rm api aisafe-api preflight

The command prints one line per check:

  • PASS means the dependency responded correctly.
  • FAIL means the deployment needs attention before running assessments.
  • SKIP means the dependency is optional or checked by another service.

The process exits 0 only when every required check passes. Use that exit code as a deploy gate in CI or automation.

Host and container monitoring​

The compose stack includes host and container metrics, and its bundled alerting warns you when the host runs low on memory or disk or when a container keeps hitting its memory limit.

Every service in the stack has a memory limit, so a service that grows out of bounds is restarted on its own instead of exhausting the host. Give the host at least the memory the stack was sized for (32 GB) and keep the limits in the compose file unless you have measured that a service needs more.