Allow for multiple php-fpm services to be run in downstream containers. #84
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This doesn't really change anything functionally in this container but allows for downstream containers to run multiple
php-fpm
services if needed.One may want to run multiple
php-fpm
services so they can include/excludephp
extensions likexdebug
dynamically. In this scenario twophp-fpm
services are running one withxdebug
loaded and the other without.nginx
then looks at the cookies of requests, if it finds aXDEBUG_SESSION
cookie it forwards the request on the thephp-fpm
socket/service which hasxdebug
enabled otherwise it passes the request to thephp-fpm
socket/service withxdebug
disabled.Why would one do this?
xdebug
really kills performance and can cause failures due to timeouts even when not running, just by having the module enabled (this includes having profiling disabled, auto debug and remote debugging disabled).Changes inspired by this article: https://jtreminio.com/blog/developing-at-full-speed-with-xdebug/
N.B. Food for thought, maybe split up php/nginx container into two. Which would allow for running multiple php containers and have them communicate over
tcp
rather thansockets
. Though no small feat lots of changes required but ultimately might be more flexible for developers.