We want Fly.io to be the best place to deploy Laravel applications in, including all other external apps needed to make a Laravel application whole.
This is why the Laravel team at Fly.io has been making efforts to create repositories and packages that help in making Laravel applications ready for live action. Take for example the fly-apps/laravel-docker repository which provides a robust base Docker image for dockerizing Laravel applications. Then of course the fly-apps/fly-laravel package: for deploying your apps live. Just run it’s launch and deploy commands to go live with your Laravel app and necessary external applications (db, cache, storage ) in the Fly.io platform!
Enter dockerfile-laravel!
This time around, we created a new cli-package, dockerfile-laravel
, geared towards dockerizing Laravel apps on top of the base docker image created from laravel-docker
. With just one command:
dockerfile-laravel generate
dependencies required by your Laravel app will be scanned for and detected, and a Dockerfile tailored to your project generated.
It’s main goal is to detect different Laravel versions, packages, and dependency combinations, and create Dockerfiles tailored to successfully running these combinations. It’s at it’s earliest stages, and currently provides support for both Laravel 10 and 11 versions. And, it’s going to continue supporting newer versions in the future.
It’s also going to be used by flyctl
in a near release to generate the Dockerfile used in deploying Laravel apps to Fly.io. That’s right! You can run it to generate Docker related files for your local Laravel container setup, and live server setup!
Ultimately:
It’s installable from packagist, and it’s repository is available publicly, with a special section on how to locally run this package. And yes, that’s where you, the Laravel Fly.io-ers community comes in!
Do test the package out, and submit any features/PR’s/issues you can.
Overtime more features can be requested, and reviewed, added, and maintained by the Laravel Fly team. Until such time dockerfile-laravel
can run to successfully dockerize any Laravel application, and, ultimately, provide a package the Laravel community can turn to generating Dockerfiles for their Laravel applications, no matter how diverse their app set up be.
It’s exciting isn’t it? I am excited for this, and I hope you at the Laravel Fly community are too!