Run Multiple Sail Apps Locally With Fleet
Published on by Paul Redmond
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
:80
port 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:8081
Instead, Fleet provides a small set of commands that alter your
docker-compose.yml
file 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 fleet:add
command:
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.