I am launching a docker environment by means of docker-compose. This provisions both a mysql and nginx process. The latter mounts a path that contains the folder that will be served.
The issue is that while nginx runs as the user 'nginx', the volume gets mounted as xfs:xfs. This causes an issue since there is a php script that needs to be able to write to disk.
On the host OS (Linux running in Vagrant, for dev purposes), the folder is owner is www-data:www-data.
I can't work out how to have the volume mounted with the appropriate user.
My environment gets loaded as follows:
docker-compose -f docker-compose-dev.yml up -d
and the nginx image part of the docker-compose-dev.yml file is:
webserver: container_name: somedomain_website image: richarvey/nginx-php-fpm:latest working_dir: /application environment: VIRTUAL_HOST: webdev.somedomain.com LETSENCRYPT_HOST: somedomain.com LETSENCRYPT_EMAIL: email@example.com # PGID: 33 # PUID: 33 volumes: - ../www/2019:/var/www/html/2019 - ./phpdocker/nginx/nginx_dev.conf:/etc/nginx/sites-available/default.conf - ./phpdocker/nginx/nginx_dev.conf:/etc/nginx/sites-enabled/default.conf - ./php/php.ini:/usr/local/etc/php/conf.d/99-overrides.ini ports: - "80:80"
BTW I did try specifying
PUID, but that breaks nginx:
2019-02-11 05:35:38,584 INFO exited: php-fpm (exit status 78; not expected) 2019-02-11 05:35:41,595 INFO spawned: 'php-fpm' with pid 25 [11-Feb-2019 05:35:41] ERROR: [pool www] cannot get uid for user 'nginx' [11-Feb-2019 05:35:41] ERROR: FPM initialization failed 2019-02-11 05:35:41,635 INFO exited: php-fpm (exit status
Can anyone suggest how to deal with this issue?
Using docker-compose 1.17.1 on Ubuntu 18.04.1 LTS.