Docker PHP permissions Docker PHP permissions docker docker

Docker PHP permissions


You need to adapt the uid & gif of www-data to match the ownership of the files.Inside your php's Dockerfile:

RUN sed -ri 's/^www-data:x:82:82:/www-data:x:1000:50:/' /etc/passwdRUN chown -R www-data:www-data /var/www/html


Do you use it under Mac? Try to append this line in your php Dockerfile:RUN usermod -G staff www-data


Another approach is to use the chown flag when copying, as stated here.

COPY --chown=<user>:<group> ...