I have a symfony setup for docker with docker-compose which is working well except when i run cache:clear from console, the webserver cant access the files.
I c
I'd think changing www-data
s userid to your host-user's id is a good solution, as permissions for the host user are fairly easy to setup.
#change www-data`s UID inside a Dockerfile
RUN usermod -u [USERID] www-data
user id 1000 is the default for most linux systems afaik... 501 on mac
you can run id -u
on the host system to find out.
You could then log into the container to run symfony commands as www-data
docker exec -it -u www-data [CONTAINER] bash
I was wondering how you could set the userid dynamically on container build.
I guess passing it via --build-arg
to docker-compose would be the way
docker-compose build --build-arg USERID=$(id -u)
...but haven't managed to access that var in the Dockerfile yet.