I’m working with a web based application and doing local development on it using docker.
My application’s docker-compose looks something like:
services: web: image: "app-web" volumes: "myapp:/var/www/html"
What I want to do, is run PHPUnit against the application, without making changes to the application code itself, as it’s a git repository.
Right now I have a separate container with PHPUnit inside of it, and I’m mounting the vendor supplied unit test library like so:
docker run --volumes-from myapp-web -v tests/var/www/html/tests testcontainer
The problem is that in order for the unit tests to run, my
testcontainer needs to run
composer dump-autoload inside
/var/www/html for the unit test classes to be picked up, which changes the applications autoload files.
Is there anyway to mount the volumes from another container and then rollback the changes afterwards, or not propagate the changes to the parent container?