I have a docker-compose setup working perfect on my local machine for my symfony projects with nginx, php7-fpm and mysql.
I often need to install new packages via composer, so I just deliver the command to my php-fpm container like this:
docker-compose exec my-php-fpm-container composer install
The problem is that install all the packages as root, so I have to chown everytime I install something.
I know that the flag "--user" exist, but if I use it, it thows the following error:
ERROR: No such service: composer
Is there any way to run the docker-compose exec command as local machine user so the new composer installed files & folders create themselves with my local linux user ownership and not root?