Dynamically change UID and GID of PHP-FPM process#14
Conversation
|
Thank you for the PR, @pierlon! It's important that systems weirdness be abstracted away as much as possible, I'm concerned about how this change would bring it to the fore. Do you have thoughts on how |
|
The UID/GID of the user could be retrieved upon running Otherwise, the user could set override those env vars in the |
|
Hey @pento, how can I proceed to get this merged? |
|
Thank you for your patience here, @pierlon. 🙂 Could I get you to have a look at #16? I've been working on it there, simplifying a lot of the generic code that we don't really need. I've been working on it in conjunction with some (currently hacky, as a proof of concept) testing on WordPress/gutenberg#17518. The Gutenberg PR shows that the permission fixes work, as I've been able to remove the old permission hacks from |
|
To keep things moving, I'm going to close this PR, and merge #16, it can be iterated on later if needed. |
|
Hey @pento, glad to see this getting some traction. I see no problems with #16 and don't think any more changes need to be made there. I'll see how I can help with WordPress/gutenberg#17518. |
Closes #13.
This PR allows for the PHP-FPM process to have a dynamic UID/GID upon startup for the PHP container. This is accomplished by creating a user and group that matches the UID and GID of the host user.
By default, a user and group called
wp_phpis created with a UID/GID of 1000. PHP-FPM is then configured to run under this user and group. The UID and GID can be overriden upon startup of the container if needed by setting thePHP_FPM_UIDandPHP_FPM_GIDenvironment variables.