After some days fumbling my way through to adapt an existing Symfony Docker setup into a PHP-agnostic Docker image, I’m happy to share frankenphp-slim
— a production-ready base for Slim Framework projects powered by FrankenPHP.
By default it installs the slim-skeleton from Packagist, so you can get started immediately.
Key features:
Production, development and CI ready
Single service by default — no unnecessary complexity
Clean, super-readable configuration
Automatic HTTPS (dev and prod)
HTTP/3 ready with HTTP/2 support
Hot Reloading
Real-time messaging via a built-in Mercure hub
Vulcain support
Rootless, slim production image
Note: FrankenPHP worker mode is not enabled in this version.
I’ve only tested this with Slim-based projects so far. I’d love to hear your feedback, suggestions, or any issues you run into!
I mostly removed “things” : configs for symfony, AI agents dev containers (which can be put back I imagine), customized dockerfiles and so on in order to demonstrate it can be used easily (ready to dev and prod) with slim projects. I actually tested it with 3 differents slim skeletons including odan’s ones that I use actually for worker mode.
Yes Caddy/ Frankenphp is pretty straightgoing in configuration if you know apache, nginx and the likes.
I think the main difference is that it not not only easier the use of frankenphp as a php interpreter and caddy as a modern web server (HTTP/3 ready, brotli/gzip compression) but it enable Vulcain/mercure for SSEs as well and some nice dev features like hot reload, watchers for code changes.
That was what was marketed by M. Dunglas and I did some testing that went into that point, those features seemed functional.
To sum up that starting template isn’t perfect but works well for a rapid start for a new slim based dev project or maybe to add some SSEs features to an existing project. It can also support worker mode (which of course, like the rest of those features, frankenphp will support natively depending of the version used).
So I think it can help structure a new project or at least give some thougths to do better starting from it !
I may also revert back directory structure used from what Dunglas did.
I didn’t like the idea to melt new project with the existing template so I created a non needed src folder layer in addition resulting in src/src/ and src/tests for instance which isn’t not nice.
So even if this template works well it is far from perfect and I see it more like a draft or PoC than a production ready template (still I’m gonna use it in prod very soon but that’s another story..)
Yay! I have now a totally working skeleton (actually the app I am working on but I can make a skeleton from it).
With worker mode, watcher enabled in dev mode along with Hot reloading feature with Twig / HTMX and native JS (ES6+).
Basically when I save a file in my project the browser reload automatically (a bit like Webpack / Vite but with no npm or yarn install, only a few HTML headers lines.. and twig condition).
It seems to work well, so if you are interested I can take some of my leasure time this summer to push this on my github, let me know.