When I open in browser http://localhost:1567/sites/default/files/styles/thumbnail/public/2017-10/478069720_1384178114_4.jpg, I see 404.
The "original" images are uploaded successfully, and the website works without any problems. Only the image styles are not generated.
My environment:
- Drupal 8. Patched with https://www.drupal.org/files/issues/944582-124.patch, see the issue: https://www.drupal.org/node/944582.
- I use the php:7.0-apache image.
- Permissions for
sites/default/files
is 755, owner is root. tmp
has 777, root.
I debugged: there is no request to index.php.
When I remove the SetHandler Drupal_Security_Do_Not_Remove ...
in /sites/default/files/.htaccess, everything works. But I do not want to remove these security headers.
FYI: in Docker for Windows everything is executed as root and default permissions are 755. See Official docker for windows documentation about file permissions.
Current workaround
Custom Dockerfile with the next lines at the end:
# Docker works with mounted directories as user with uid 1000.
# A www-data should be 1000 to prevent problems with permissions in /sites/default/files directory.
RUN usermod -u 1000 www-data && adduser dev --disabled-password --gecos "" && usermod -aG www-data dev