TL;DR
If a web request shells out to a slow CLI (docker, kubectl, rsync…), move it to a queued job — PHP-FPM/nginx will kill it at ~30s anyway.
Processes spawned from an HTTP worker inherit almost no environment: no HOME, a bare PATH. Tools that read ~/.docker or ~/.kube silently fail. Inject the env explicitly.
Wrap the shell-out in a driver/contract so you can fake it in tests instead of running real docker in CI.
The setup






