I've got a docker container that has PHP-FPM in it with a www-data
user. I have a volume that maps my local app to the /var/www/html
directory. I found the UID of the www-data
(let's say 33). On my local machine, I chown'd the application directory to 33:hostuser, where 33 is the www-data user in Docker, and hostuser is the group I belong to on the host. Now PHP-FPM can write to logs and such in the application, and I can write the files locally.
Now the tricky part: I'm working on getting PhpStorm to run PHPUnit tests, and I'm setting the docker container as a remote interpreter for PHP. In other words, PhpStorm will HHS into the container and run the tests. So now I need to create a new user in the container that I can SSH into. Now the problem: this new user is not the owner of the app directory (www-data is), and the group doesn't belong to anyone within the container.
Am I going about this the right way? If so, what's the best way to let all 3 users have access to the container? I was thinking of enabling SSH for the www-data user, but I'm having trouble getting that to work, and I'm not sure it's a good idea anyways.