Laravel Fleet is a package by Andrew Schmelyun to run multiple Laravel Sail websites locally with custom domain names:
Laravel Sail uses Docker and Docker Compose to spin up containers that create a local development environment for your application.
By default, the containers are bound to the
:80port of your local machine. Spinning up a second application results in a failure due to port conflicts, but you can always adjust it so that the second app is available at something like
Instead, Fleet provides a small set of commands that alter your
docker-compose.ymlfile to provide support for Traefik, a reverse proxy that runs on a Docker container.
This package provides artisan commands to add Fleet support to an application. Once you install the Fleet package, you can add your application using the
php artisan fleet:addphp artisan fleet:add my-app.localhost./vendor/bin/sail up
And your application should be available using the domain provided. Using the
fleet:stop Artisan command, you can stop all fleet-powered applications. Check out aschmelyun/fleet for complete setup instructions and documentation.
Andrew also has a YouTube video if you want a deeper dive into using Traefik to manage multiple sites with Docker Compose.
Full stack web developer. Author of Lumen Programming Guide and Docker for PHP Developers.