I wanted to mount my settings.php, but the sed -i commands in run.sh do not work on "busy files", so this uses a temporary file which will be written to the mounted file after it is edited.
But because the sed -i commands were also responsible of changing the permissions of the files from ownership root to www-data[^1], we also need to correct the permissions in the Dockerfile
[^1]: Took me a while to debug this. But apparently, if you have a file owned by root in a directory owned by you, you can remove it. This is what sed -i essentially does, but it looks like it "changed ownership".
I wanted to mount my settings.php, but the
sed -i
commands inrun.sh
do not work on "busy files", so this uses a temporary file which will be written to the mounted file after it is edited. But because thesed -i
commands were also responsible of changing the permissions of the files from ownershiproot
towww-data
[^1], we also need to correct the permissions in the Dockerfile[^1]: Took me a while to debug this. But apparently, if you have a file owned by root in a directory owned by you, you can remove it. This is what
sed -i
essentially does, but it looks like it "changed ownership".