Skip to content

Commit 9bf66f4

Browse files
authored
Fix FrankenPHP Docker example and add local dev tip (#8177)
- Replace WORKDIR with SERVER_ROOT env var to correctly set FrankenPHP's document root to /app/webroot (default is /app/public) - Fix composer install running in wrong directory (webroot/ instead of /app) - Add tip about bin/cake server --frankenphp for local development
1 parent b68bf85 commit 9bf66f4

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

docs/en/installation.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,10 +389,11 @@ FROM dunglas/frankenphp
389389
# Copy your CakePHP application
390390
COPY . /app
391391

392-
# Set working directory
393-
WORKDIR /app/webroot
392+
# FrankenPHP defaults to /app/public as document root.
393+
# CakePHP uses webroot/ instead, so override it:
394+
ENV SERVER_ROOT=/app/webroot
394395

395-
# Install dependencies if needed
396+
# Install dependencies (composer.json lives in /app)
396397
RUN composer install --no-dev --optimize-autoloader
397398

398399
# Build and run:
@@ -425,6 +426,14 @@ myapp.local {
425426

426427
:::
427428

429+
::: tip Local Development
430+
For local development, you can use the built-in CakePHP development server with FrankenPHP support:
431+
```bash
432+
bin/cake server --frankenphp
433+
```
434+
This requires the `frankenphp` binary to be available in your `PATH`.
435+
:::
436+
428437
::: info Why FrankenPHP?
429438
FrankenPHP combines PHP with Caddy, providing automatic HTTPS, HTTP/3, and modern compression without needing PHP-FPM. Particularly efficient for containerized deployments.
430439
:::

0 commit comments

Comments
 (0)