fly-apps / laravel-docker

Base Docker images for use with Laravel on Fly.io
43 stars 8 forks source link

Franken PHP #11

Closed MaximeGratens closed 8 months ago

MaximeGratens commented 9 months ago

Hello,

We are exploring the use of https://frankenphp.dev/ with our laravel projects.

As you may know, FrankenPHP has garnered positive attention from key figures in the Laravel community, including Taylor Otwell and the Laravel team. It's also anticipated to play a significant role in upcoming Laravel features. Given these developments, we are contemplating a migration to FrankenPHP for our application.

Could you share your thoughts on migrating to this tool?

fideloper commented 9 months ago

Hey!

Since Fly just needs a working Dockerfile, almost the only thing you'll need is to grab the official Franken Docker image and use that instead.

If you already have an app running, it MIGHT be as simple as replacing the Dockerfile. There might be a few catches:

  1. Configuring Caddy to listen on port 8080
  2. Telling Caddy not to attempt to create a certificate (since Fly will do that for you)

The Franken docs has some clues on configuring Caddy - it's basically replacing a file in their official Docker image when you build your own image.

Running CRON/Queues is basically the same as documented, except the commands to run bcome something like php-cli artisan queue:listen.

(Actually you may need to install CRON yourself if you want your scheduler to run on CRON).

That's just a quick brain dump - tl;dr: Should work, but requires a little bit of a lift for the finer details. It's mostly Caddy configuration.

fideloper commented 8 months ago

FYI I'm working on Octane frankenphp, since it's officially supported (versus non-octane flavored).