Tech
Two gotchas when your Laravel app shells out to a CLI
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
I have an app that pro...
Read the full discussion on Dev.to
This article was aggregated from Dev.to. Click to join the conversation.
View on Dev.to