{"id":17105016,"url":"https://github.com/gilbitron/traefik-laravel","last_synced_at":"2026-03-18T23:23:41.208Z","repository":{"id":137547866,"uuid":"511498967","full_name":"gilbitron/traefik-laravel","owner":"gilbitron","description":"This is a simple Traefik proxy setup for running multiple Laravel Sail instances.","archived":false,"fork":false,"pushed_at":"2022-08-29T08:49:13.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-29T03:51:55.165Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"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/gilbitron.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-07-07T11:23:58.000Z","updated_at":"2023-04-17T08:55:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"2c11e516-ebea-4524-a2e6-ca4c8f51aaa3","html_url":"https://github.com/gilbitron/traefik-laravel","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gilbitron%2Ftraefik-laravel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gilbitron%2Ftraefik-laravel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gilbitron%2Ftraefik-laravel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gilbitron%2Ftraefik-laravel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gilbitron","download_url":"https://codeload.github.com/gilbitron/traefik-laravel/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245162190,"owners_count":20570692,"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":[],"created_at":"2024-10-14T15:40:19.167Z","updated_at":"2026-01-04T23:05:50.418Z","avatar_url":"https://github.com/gilbitron.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Traefik Laravel\n\nThis is a simple [Traefik proxy](https://traefik.io/traefik/) setup for running multiple [Laravel Sail](https://laravel.com/docs/9.x/sail) instances. It uses the [bjornsnoen/minica-api](https://github.com/bjornsnoen/minica-api) package to auto-generate self-signed SSL certificates.\n\n## Install\n\nFirst, create a new network called `web`:\n\n```\ndocker network create web\n```\n\nThen, simply run the docker compose file:\n\n```\ndocker compose up -d\n```\n\nYou should now be able to visit [https://traefik.test](https://traefik.test) and [https://whoami.test](https://whoami.test) to confirm that the proxy is working properly.\n\n## Adding Sail Apps\n\nTraefik proxy auto-discovery works by adding labels to your containers. To have a Laravel Sail app discovered by Traefik, update the `docker-compose.yml` to look like this:\n\n```diff\nversion: '3'\nservices:\n  laravel:\n    build:\n      context: ./vendor/laravel/sail/runtimes/8.1\n      dockerfile: Dockerfile\n      args:\n        WWWGROUP: '${WWWGROUP}'\n    image: sail-8.1/app\n    extra_hosts:\n      - 'host.docker.internal:host-gateway'\n    ports:\n-     - '${APP_PORT:-80}:80'\n      - '${VITE_PORT:-5173}:${VITE_PORT:-5173}'\n    environment:\n      WWWUSER: '${WWWUSER}'\n      LARAVEL_SAIL: 1\n      XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}'\n      XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}'\n    volumes:\n      - '.:/var/www/html'\n    networks:\n      - sail\n+     - web\n+   labels:\n+     - \"traefik.enable=true\"\n+     - \"traefik.http.routers.laravel.rule=Host(`laravel.test`)\"\n+     - \"traefik.http.routers.laravel.tls=true\"\n+     - \"traefik.http.services.laravel.loadbalancer.server.port=80\"\n+     - \"traefik.docker.network=web\"\n\n# ...\n\nnetworks:\n  sail:\n    driver: bridge\n+ web:\n+   external: true\n```\n\nNote, we've had to rename the container to \"laravel\" as we can't use \"laravel.test\" in the traefik labels. You should also add the following to your `.env`:\n\n```\nAPP_SERVICE=laravel\n```\n\nAfter running `sail up` your site should now be running at [https://laravel.test](https://laravel.test).\n\n## Trusting Certificates\n\nYou can add `./certificates/minica.pem` file to your keychain or local trust store to trust the certificates.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgilbitron%2Ftraefik-laravel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgilbitron%2Ftraefik-laravel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgilbitron%2Ftraefik-laravel/lists"}