Conversation
Add reference configuration for self-hosting ChurchCRM with FrankenPHP, an all-in-one server that bundles Caddy and PHP in a single binary. - docker/Dockerfile.churchcrm-frankenphp: multi-stage image based on dunglas/frankenphp:1-php8.4 with all required PHP extensions installed via install-php-extensions - docker/frankenphp/Caddyfile: Caddy routing config that mirrors the nginx setup, explicitly routing each Slim 4 sub-app (session, api, v2, admin, finance, kiosk, plugins, external, setup) to its own index.php; includes commented subdirectory install variant - docker/docker-compose.frankenphp.yaml: two-service compose file (FrankenPHP + MariaDB), simpler than the nginx + PHP-FPM setup - docker/README.md: FrankenPHP section with routing explanation, quick start, files table, Caddyfile customisation, and extension list Co-authored-by: DawoudIO <554959+DawoudIO@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a reference FrankenPHP (Caddy + PHP) deployment option for ChurchCRM’s multi-entry-point Slim 4 layout, including explicit per-subdirectory routing to avoid /session/begin redirect loops in non-Apache setups.
Changes:
- Added a FrankenPHP-compatible Caddyfile with explicit routing for each Slim sub-app entry point.
- Added a FrankenPHP + MariaDB docker-compose reference stack.
- Added a FrankenPHP Dockerfile and updated Docker documentation to include the new deployment option.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
docker/frankenphp/Caddyfile |
New Caddy routing and access control rules tailored to ChurchCRM’s multi-entry-point structure. |
docker/docker-compose.frankenphp.yaml |
New two-service (FrankenPHP + MariaDB) reference compose configuration. |
docker/Dockerfile.churchcrm-frankenphp |
New FrankenPHP image build (extensions + dev tooling stage). |
docker/README.md |
Documents FrankenPHP deployment rationale, quick start, and file list. |
| # Block .htaccess and other dot-files | ||
| @dotfiles path_regexp hidden (^|/)\. |
There was a problem hiding this comment.
The @dotfiles matcher blocks any path containing a dot segment, which also matches /.well-known/*. That will break Caddy’s automatic HTTPS (ACME HTTP-01 challenge uses /.well-known/acme-challenge/). Consider exempting /.well-known/* (or at least /.well-known/acme-challenge/*) from this rule, and mirror the same exception in the commented subdirectory-install example below.
| # Block .htaccess and other dot-files | |
| @dotfiles path_regexp hidden (^|/)\. | |
| # Block .htaccess and other dot-files, but allow /.well-known/* for ACME HTTP-01 | |
| @dotfiles path_regexp hidden (^|/)\.(?!well-known(/|$)) |
| @logs path /logs/* | ||
| respond @logs 404 | ||
|
|
||
| # Block access to uploaded file attachments (served via API only) | ||
| @tmp_attach path /tmp_attach/* |
There was a problem hiding this comment.
The path matchers for sensitive directories only cover /logs/* and /tmp_attach/*, but not the directory roots /logs and /tmp_attach (no trailing slash). Since the root handler uses try_files {path} {path}/ ..., requests to /logs or /tmp_attach can still hit the normal routing path; update these matchers to include both the directory itself and its contents (and do the same in the commented subdirectory-install example).
| @logs path /logs/* | |
| respond @logs 404 | |
| # Block access to uploaded file attachments (served via API only) | |
| @tmp_attach path /tmp_attach/* | |
| @logs path /logs /logs/* | |
| respond @logs 404 | |
| # Block access to uploaded file attachments (served via API only) | |
| @tmp_attach path /tmp_attach /tmp_attach/* |
ChurchCRM's multi-entry-point Slim 4 architecture requires explicit per-subdirectory routing — without it, unauthenticated users hit an infinite redirect loop (
/session/begin→ rootindex.php→/session/begin→ …). Apache handles this via.htaccess; FrankenPHP (like nginx) requires explicit configuration.New files
docker/Dockerfile.churchcrm-frankenphp— Multi-stage image based ondunglas/frankenphp:1-php8.4. Uses the bundledinstall-php-extensionshelper for all required extensions.devstage mirrors the pattern from the other Dockerfiles (Xdebug, Composer, Node.js).docker/frankenphp/Caddyfile— Routes each Slim 4 sub-app to its own entry point usinghandle+try_files, blocking/logs/*,/tmp_attach/*, and dotfiles. Includes a commented subdirectory-install variant.docker/docker-compose.frankenphp.yaml— Two-service stack (FrankenPHP + MariaDB), one fewer container than the nginx + PHP-FPM reference setup.Updated files
docker/README.md— FrankenPHP section: routing explanation, quick start, files table, Caddyfile customisation (including Caddy's automatic HTTPS).Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.