I prefer to run Laravel projects directly on my local device (using Laravel Herd), but for anyone that doesn't want to install php and other dependencies, this might simplify development.
Usage
APP_PORT=8080 vendor/bin/sail up (port 80 is default, but we could change default to a port that is less likely to be in use)
npm and artisan commands can be run inside the container by sail artisan X and sail npm run Y
sail artisan migrate:fresh --seed to refresh database to local seeded state (see seeders for example accounts).
sail npm run dev to start Vite in dev mode.
Local files are shared with container via a volume, so development can be done against local files and changes should reflect automatically without restarting or rebuilding docker image.
Inspired by https://github.com/Krisell/gkk-anmalan/pull/64
This installs Laravel Sail, the Laravel first party Docker integration for local development. https://laravel.com/docs/11.x/sail
I prefer to run Laravel projects directly on my local device (using Laravel Herd), but for anyone that doesn't want to install php and other dependencies, this might simplify development.
Usage
APP_PORT=8080 vendor/bin/sail up
(port 80 is default, but we could change default to a port that is less likely to be in use)npm
andartisan
commands can be run inside the container bysail artisan X
andsail npm run Y
sail artisan migrate:fresh --seed
to refresh database to local seeded state (see seeders for example accounts).sail npm run dev
to startVite
in dev mode.Local files are shared with container via a volume, so development can be done against local files and changes should reflect automatically without restarting or rebuilding docker image.