I'm developing a PHP 7.1 web application using the following:
- Symfony 3.2
- Docker Compose 1.12.0
- Ubuntu 16.04 x64
When running docker-compose up -d
, my bind mounted project directory's owner and group are changed to root. Thus, whenever I try to commit a change or pull from my remote with git pull
, I'll see the following:
error: unable to unlink old 'gulpfile.js' (Permission denied)
fatal: Could not reset index file to revision 'HEAD^'.
Changing the project directory's owner and group back to my user removes the error. Is there an easier way to prevent these user permission conflicts while developing with Docker Compose?
EDIT
Here is an overview of my current directory structure:
dockerComposeAndProjectDir/
|-- projectDirectory/
|-- dockerComposeDirectory/
|-- docker-compose.yml