I’m running Docker version 17.03.0-ce, build 60ccb22 on Ubuntu 16.0.4. My container derives from php:7.1-apache
. The Dockerfile and docker-compose.yml live in the root my of git repository. The repo is mounted to the container with the following docker-compose line:
volumes:
- .:/var/www
I have a file called ./data/settings.sqlite
it needs to be writable by the apache user www-data. I also need to write it as my local user on the host ubuntu system.
After I restart the container I can execute setfacl -R -m u:www-data:rwX
./data/ (sqlite needs write access to the folder to make the temp transaction files). However, I can’t put that command in a RUN statement in the Dockerfile because the RUN statement executes before the volume is mounted by docker.
Whats the best way to make sure that setfacl commands gets run at startup, after the volume is mounted?