wodby / drupal-php

PHP docker container image for Drupal
https://wodby.com/stacks/drupal
MIT License
60 stars 81 forks source link

Omit permission issues #6

Closed peperoni60 closed 7 years ago

peperoni60 commented 7 years ago

Normally you issue commands (drush, drupal, composer) as root user or as user 82 (if explicitly provided). But with both users you will run into permission problems as the files on the host machine are created as privileged (root) or unknown (82) user and you can't edit any of the generated / downloaded files. You could easily avoid such problems if you add a umask 000 in the docker entrypoint to set the file permissions accordingly (777).

csandanov commented 7 years ago

Drush, drupal, composer are now installed for www-data user. Also, a new article was added on how to avoid permissions problems.

peperoni60 commented 7 years ago

I have read the article and do not agree with you. Do you really mean I should patch my system to avoid permission problems that occur through your system?

csandanov commented 7 years ago

Our images are based on official php images (alpine linux). UID/GID 82 is a standard for www-data user in alpine linux and hardcoded in the official php image. If you don't want to add a group on your host machine, you can always change permissions on the files directory.

Also, you can build your own image based on ours and re-create www-data user with gid/uid matching your host user or, as you suggested, set umask in the entrypoint / init script.