Given a pod running an Nginx container, and a PHP-FPM container, what would be the best practice for the applications document permissions?
At the moment I have a volume shared between the containers so that Nginx has access to the PHP files. This works, but the files are owned by the user www-data
in the FPM container, which does not exist in the Nginx container, resulting in them being owned by whichever user has the same UID.
This is obviously wrong, but then what's right? Options I've considered so far:
- Files are owned by
nobody:nogroup
- Make a copy of the files for Nginx, and assign ownership to the
nginx
user in that container - Align the UIDs
- Run both Nginx and FPM in the same container
None of these seem appealing.