{"id":16108215,"url":"https://github.com/aschmelyun/fleet","last_synced_at":"2025-04-12T19:50:30.411Z","repository":{"id":65291211,"uuid":"589070510","full_name":"aschmelyun/fleet","owner":"aschmelyun","description":"Run multiple Laravel Sail websites locally with custom domain names and https","archived":false,"fork":false,"pushed_at":"2024-06-02T21:11:12.000Z","size":41,"stargazers_count":315,"open_issues_count":13,"forks_count":13,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-10-10T19:25:28.600Z","etag":null,"topics":["docker","laravel"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aschmelyun.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-15T00:20:19.000Z","updated_at":"2024-10-08T15:30:52.000Z","dependencies_parsed_at":"2024-10-25T22:41:46.664Z","dependency_job_id":null,"html_url":"https://github.com/aschmelyun/fleet","commit_stats":{"total_commits":19,"total_committers":2,"mean_commits":9.5,"dds":"0.10526315789473684","last_synced_commit":"2bffd6b6c0dcb7c778c8ccc60ff6b7e40480b8ad"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aschmelyun%2Ffleet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aschmelyun%2Ffleet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aschmelyun%2Ffleet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aschmelyun%2Ffleet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aschmelyun","download_url":"https://codeload.github.com/aschmelyun/fleet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248625501,"owners_count":21135513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","laravel"],"created_at":"2024-10-09T19:25:56.647Z","updated_at":"2025-04-12T19:50:30.389Z","avatar_url":"https://github.com/aschmelyun.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fleet\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/aschmelyun/fleet.svg?style=flat-square)](https://packagist.org/packages/aschmelyun/fleet)\n[![Total Downloads](https://img.shields.io/packagist/dt/aschmelyun/fleet.svg?style=flat-square)](https://packagist.org/packages/aschmelyun/fleet)\n\nEasily run multiple Laravel Sail applications at the same time locally with custom domain names.\n\n\u003e Note: This is still new and may contain bugs, if you see something weird please [create an issue](https://github.com/aschmelyun/fleet/issues/new)\n\n- [Installation](#installation)\n- [Getting Started](#getting-started)\n- [Local SSL](#local-ssl)\n- [Port Conflicts](#port-conflicts)\n- [Additional Usage](#additional-usage)\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require aschmelyun/fleet --dev\n```\n\n## Getting Started\n\nNavigate to the root directory of your Laravel application, and stop any Sail instance if it's running. Then, use the following command to add Fleet support to your app:\n\n```bash\nphp artisan fleet:add\n```\n\nDuring setup you'll be prompted to enter in a domain name. Alternatively, you can pass it in through the command line:\n\n```bash\nphp artisan fleet:add my-app.localhost\n```\n\nAfter the setup finishes, you can start up Sail just like normal:\n\n```bash\n./vendor/bin/sail up\n```\n\nAnd your site will be available at the domain you provided!\n\n\u003e Note: If you chose a domain that doesn't end in `.localhost`, you will need to add an entry to your hosts file to direct traffic to 127.0.0.1\n\n## Local SSL\n\nFleet supports local SSL on your custom domains through the power of [mkcert](https://mkcert.dev). After you've installed it on your machine, you can use the `--ssl` option when using the `fleet:add` command to enable it for your application.\n\n```bash\nphp artisan fleet:add my-app.localhost --ssl\n```\n\nA local certificate will be generated and stored in `~/.config/mkcert/certs`. After spinning up your site with Sail, your specified domain will have https enabled.\n\n## Port Conflicts\n\nWhen spinning up multiple Laravel Sail appliactions, it's likely you'll encounter an error about port conflicts between Docker containers. This is because each service has a port mapped to your local machine, and by default, they're the same across your applications.\n\nIn order to fix this, add different forwarded port numbers to each Laravel application using the `.env` file. For example:\n\n- App #1\n\n```env\nFORWARD_DB_PORT=3306\nFORWARD_REDIS_PORT=6379\n```\n\n- App #2\n\n```env\nFORWARD_DB_PORT=4306\nFORWARD_REDIS_PORT=7379\n```\n\nThis way, both applications can be spun up using Fleet and Sail, and their respective services' ports won't conflict.\n\n## Additional Usage\n\nBy default, whenever you use `fleet:add`, a Docker network and container are both started to handle the traffic from your local domain name(s).\n\nYou can start this manually by using:\n\n```bash\nphp artisan fleet:start\n```\n\nIf you would like to remove Fleet support from an application and return it back to the default Docker setup, you can run:\n\n```bash\nphp artisan fleet:remove\n```\n\nTo stop and remove all Fleet containers and networks that are currently running on your system, you can use the command:\n\n```bash\nphp artisan fleet:stop\n```\n\n## Why use this?\n\n[Laravel Sail](https://laravel.com/docs/sail) uses Docker and Docker Compose to spin up containers that create a local development environment for your application.\n\nBy 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`.\n\nThis can have some unintended consequences though, and can get messy juggling communication between two different applications using port numbers.\n\nInstead, Fleet provides a small set of commands that alter your `docker-compose.yml` file to provide support for [Traefik](https://hub.docker.com/_/traefik), a reverse proxy that runs on a Docker container.\n\nWhen you add a site to Fleet, a network and a few labels are added to the Docker Compose entry for your application, and a main Traefik container is spun up to handle all local web traffic incoming to the `:80` port.\n\nThis configuration allows two or more Laravel Sail applications configured to different domains to resolve to their respective running containers.\n\nFor a more in-depth look at how this all ties together, check out [this video](https://www.youtube.com/watch?v=mZbLvGQqEvY) that I published on using Traefik with Docker Compose.\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what's recently changed.\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faschmelyun%2Ffleet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faschmelyun%2Ffleet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faschmelyun%2Ffleet/lists"}