Files
absdev-deployment/docs/NGINX-CONTAINMENT.md
T
Mark Gregory bd0279d91b
ABSDEV Framework CI / framework-ci (push) Successful in 22s
Integrate durable Nginx and worker containment into the runtime
2026-11-27 19:09:31 +00:00

1.8 KiB

Supported Docker Compose containment

Use core.services.ContainedServiceLifecycle for deployments and confirmed rollbacks through the framework's Docker Compose runtime. Pass it to DeploymentController and RollbackExecutor with their shared site lock. The runtime requires a trusted Docker runner, a probe that positively observes the public maintenance response, and a probe that reports each worker's actual running state. Health validation uses a protected origin that can check the active release while public HTTP is in maintenance.

Give the runtime a canonical, operator-owned gate directory. Bind-mount that directory read-only into Nginx, and make it traversable by the Nginx worker. Keep the directory on persistent storage. In the public server's application location, check the sentinel before proxying or serving application files.

if (-f /fixture/gate/closed) {
    return 503 "maintenance\n";
}

Keep the protected health listener off the public and edge networks. Configure worker containers so a daemon or host restart cannot start them while containment is active. The runtime stops both workers and checks their actual state. A web service restart reads the same persistent sentinel.

The controller seals ingress before stopping workers. It checks containment around the PHP restart and Nginx reload. It verifies candidate health and writes the completion record before starting workers. It removes the sentinel only after both workers report running. Failed health leaves both controls engaged. If reopening fails, the runtime stops the workers again and leaves the site in maintenance for explicit review. The existing journal and rollback result record the activation and health outcome independently of reopening.

These controls are available to the trusted runtime composition. The operational production CLI remains disabled.