This is a freshly installed Laravel 9 project created using the online builder script. It attempts to use Caddy as a reverse proxy for SSL testing with the Laravel Sail Docker workflow. The original concept is documented here.
The issue demonstrated in this project is described here.
Finally, the method being employed here is demonstrated more simply in the following Gist.
Deploy this example as follows.
git clone https://github.com/Nilpo/caddy-laravelsail.git && cd caddy-laravelsail
docker run --rm --interactive --tty -v $(pwd):/app composer install
./vendor/bin/sail up --build -d
While not entirely necessary for this demo, you may also install database migrations, NPM dependencies, and run the Vite dev script.
./vendor/bin/sail artisan migrate
./vendor/bin/sail npm -i && ./vendor/bin/sail npm run dev
If you make any major changes or alter the Caddy config, you must rebuild all containers.
./vendor/bin/sail up --build --remove-orphans -d
For debugging purposes, the .env file has been committed to this repository. This is not a secure practice. As such, this project should not be forked or used as the basis of a production project.
The Laravel framework is open-sourced software licensed under the MIT license.