chilio / laravel-dusk-ci

Docker Test suite for Laravel Dusk in gitlab CI
MIT License
160 stars 51 forks source link

Permission issue #60

Closed Broutard closed 3 years ago

Broutard commented 3 years ago

I'm facing a premission issue.

In my .gitlab-ci.yml file tests are run by php artisan dusk... but it is executed as root.

My dusk test use a Laravel factory which create a file in storage (an image associated to an article), so this relative folder/file is created as root. So when I try to change this file with dusk (so with www-data), I'm facing a premission issue.

Is it possible to run dusk as www-data ? Maybe you can add sudo in the container ?

Broutard commented 3 years ago

Seems works with su www-data -s /bin/bash -c "php artisan dusk --colors --debug"

chilio commented 3 years ago

By default this docker is running as root, as the vast majority of docker images. .gitlab-ci.yml is completely customizable, so you can run dusk anylike you want, like in the example you provided.

Broutard commented 3 years ago

Maybe just add sudo to simplify this.