How to use in local development? #674
Replies: 1 comment
-
|
The issue is that you're running php artisan as root inside the container, so generated files are owned by root and uneditable on your host. Solution: run artisan via docker compose exec with the correct user:
This runs the command as www-data, whose UID/GID are mapped to your host user via the PUID/PGID env vars — so the generated file will be owned by you on the host. To avoid typing -u www-data every time, you can set the default user in your compose service: Or create a shell alias:
Then just run |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Sorry I'm new in docker.
In production I doesn't have a trouble, but in local development i confused.
In my project using Laravel Inertia React, when I create a seeder using
php artisan make:seeder, it always has a problem because the file owner is root so I can't edit it in VS Code. If I runphp artisan make:seedernot as root, it will give an error because other than root, it can't be done. What is the solution?Beta Was this translation helpful? Give feedback.
All reactions