My php container does not have the permissions to write cache on the mounted volume.
docker-compose.yml:
version: '2'
volumes:
database_data:
driver: local
services:
php:
build: ./docker/php/
expose:
- 9000
volumes:
- ./public:/var/www/html
working_dir: /var/www/html
nginx:
image: nginx:latest
depends_on:
- php
ports:
- 80:80
volumes:
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
volumes_from:
- php
docker/php/Dockerfile:
FROM php:7.0-fpm
RUN docker-php-ext-install pdo_mysql \
&& docker-php-ext-install json
# Permission fix
RUN usermod -u 1000 www-data
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/passwd
RUN chown -R www-data:www-data /var/www/html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With