Skip to content

Commit 61e0e51

Browse files
committed
Release v1.6.2: demo FRANKENPHP_MODE classic/worker switch.
Add Compose-driven FrankenPHP mode via entrypoint (worker default, classic for Caddyfile.dev) and align DEMO docs; no consumer API changes.
1 parent 8b5229f commit 61e0e51

10 files changed

Lines changed: 70 additions & 14 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ Generate keys in Beacon project settings, or run `make seed` in the `symfony-bea
118118

119119
## FrankenPHP worker
120120

121-
The bundled demo uses FrankenPHP. Its production-style Caddyfile enables worker mode, while local dev defaults to `Caddyfile.dev` without workers so code changes show up immediately. See [Demo/FrankenPHP](docs/DEMO-FRANKENPHP.md).
121+
The bundled demo uses FrankenPHP. Default **`FRANKENPHP_MODE=worker`**; set `classic` for `Caddyfile.dev` (hot-reload friendly). See [Demo/FrankenPHP](docs/DEMO-FRANKENPHP.md).
122122

123123
## Documentation
124124

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
},
8181
"config": {
8282
"sort-packages": true,
83-
"root-version": "1.6.1-dev",
83+
"root-version": "1.6.2-dev",
8484
"allow-plugins": {
8585
"phpstan/extension-installer": true
8686
},

demo/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ make up-symfony8
1717

1818
The demo includes:
1919

20-
- FrankenPHP with Caddy (HTTP on `:80` inside container). Default **`APP_ENV=dev`** uses **Caddyfile.dev** (no PHP worker); see [docs/DEMO-FRANKENPHP.md](../docs/DEMO-FRANKENPHP.md) for production (worker) vs development.
20+
- FrankenPHP with Caddy (HTTP on `:80` inside container). Default **`FRANKENPHP_MODE=worker`**; set `classic` in `.env` for `Caddyfile.dev` (no PHP worker). See [docs/DEMO-FRANKENPHP.md](../docs/DEMO-FRANKENPHP.md).
2121
- Web Profiler enabled in `dev`
2222
- Nowo Twig Inspector enabled in `dev`
2323
- `symfony/messenger` + console boom command

demo/symfony8/.env.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ APP_ENV=dev
44
# APP_DEBUG: Enable/disable detailed debug output (usually `1` in dev).
55
APP_DEBUG=1
66

7+
# FRANKENPHP_MODE: FrankenPHP runtime mode — `classic` (one process per request) or `worker` (long-lived workers).
8+
# Default: worker. Set classic for per-request PHP / easier hot-reload. Recreate with `docker compose up -d` after change.
9+
FRANKENPHP_MODE=worker
10+
711
# APP_SECRET: Secret used for signing/tokens. Use a local-only value in demos.
812
APP_SECRET=CHANGE_ME_LOCAL_SECRET
913

demo/symfony8/Dockerfile

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,7 @@ ENV SERVER_NAME=:80
1919
COPY docker/frankenphp/Caddyfile /etc/frankenphp/Caddyfile
2020
COPY docker/frankenphp/Caddyfile.dev /etc/frankenphp/Caddyfile.dev
2121

22-
RUN echo '#!/bin/sh' > /usr/local/bin/docker-entrypoint.sh && \
23-
echo 'set -e' >> /usr/local/bin/docker-entrypoint.sh && \
24-
echo 'if [ "${APP_ENV:-prod}" = "dev" ]; then cp /etc/frankenphp/Caddyfile.dev /etc/frankenphp/Caddyfile; fi' >> /usr/local/bin/docker-entrypoint.sh && \
25-
echo 'mkdir -p /app/var/cache /app/var/log' >> /usr/local/bin/docker-entrypoint.sh && \
26-
echo 'chmod -R 777 /app/var' >> /usr/local/bin/docker-entrypoint.sh && \
27-
echo 'exec frankenphp run --config /etc/frankenphp/Caddyfile --adapter caddyfile' >> /usr/local/bin/docker-entrypoint.sh && \
28-
chmod +x /usr/local/bin/docker-entrypoint.sh
22+
COPY docker/entrypoint.sh /usr/local/bin/docker-entrypoint.sh
23+
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
2924

3025
ENTRYPOINT ["docker-entrypoint.sh"]

demo/symfony8/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ services:
1919
- APP_ENV=dev
2020
- APP_DEBUG=1
2121
- APP_SECRET=${APP_SECRET:-demo-secret}
22+
- FRANKENPHP_MODE=${FRANKENPHP_MODE:-worker}
2223
# Reach Symfony Beacon published on the host (HTTP :9081 / HTTPS :9444).
2324
extra_hosts:
2425
- "host.docker.internal:host-gateway"

demo/symfony8/docker/entrypoint.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/sh
2+
set -e
3+
4+
# FRANKENPHP_MODE: classic | worker (REQ-DEMO-010). Default: worker.
5+
# Set via .env / Compose only — not baked into the image ENV.
6+
MODE="${FRANKENPHP_MODE:-worker}"
7+
case "$MODE" in
8+
classic)
9+
cp /etc/frankenphp/Caddyfile.dev /etc/frankenphp/Caddyfile
10+
;;
11+
worker)
12+
# Prefer bind-mounted project file so edits apply without rebuild.
13+
if [ -f /app/docker/frankenphp/Caddyfile ]; then
14+
cp /app/docker/frankenphp/Caddyfile /etc/frankenphp/Caddyfile
15+
fi
16+
# else keep the image-baked worker Caddyfile
17+
;;
18+
*)
19+
echo "Unknown FRANKENPHP_MODE=$MODE (expected classic|worker)" >&2
20+
exit 1
21+
;;
22+
esac
23+
echo "FrankenPHP mode: $MODE"
24+
25+
mkdir -p /app/var/cache /app/var/log
26+
chmod -R 777 /app/var
27+
exec frankenphp run --config /etc/frankenphp/Caddyfile --adapter caddyfile

docs/CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
66

77
## [Unreleased]
88

9+
## [1.6.2] - 2026-07-22
10+
11+
### Added
12+
13+
- Demo Symfony 8: `FRANKENPHP_MODE` (`worker` default / `classic`) via Compose + `docker/entrypoint.sh` (selects worker Caddyfile vs `Caddyfile.dev` without rebuilding the image)
14+
15+
### Changed
16+
17+
- Docs (`DEMO-FRANKENPHP.md`, demo/README, root README): document classic vs worker switching; recreate containers after changing `.env`
18+
919
## [1.6.1] - 2026-07-21
1020

1121
### Added
@@ -218,7 +228,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
218228
- Expanded documentation set for installation, configuration, usage, release, security, performance, Engram, and Spec Kit workflows.
219229
- Demo routes covering message capture, manual exception capture, listener-triggered exceptions, ignored exceptions, fingerprints, and runtime status.
220230

221-
[Unreleased]: https://github.com/nowo-tech/BeaconBundle/compare/v1.6.1...HEAD
231+
[Unreleased]: https://github.com/nowo-tech/BeaconBundle/compare/v1.6.2...HEAD
232+
[1.6.2]: https://github.com/nowo-tech/BeaconBundle/compare/v1.6.1...v1.6.2
222233
[1.6.1]: https://github.com/nowo-tech/BeaconBundle/compare/v1.6.0...v1.6.1
223234
[1.6.0]: https://github.com/nowo-tech/BeaconBundle/compare/v1.5.1...v1.6.0
224235
[1.5.1]: https://github.com/nowo-tech/BeaconBundle/compare/v1.5.0...v1.5.1

docs/DEMO-FRANKENPHP.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Demo / FrankenPHP
22

3-
BeaconBundle demos use **FrankenPHP + Caddy**. The production Caddyfile enables worker mode, while the default development setup uses `Caddyfile.dev` without workers so file changes are visible on refresh.
3+
BeaconBundle demos use **FrankenPHP + Caddy**. Runtime mode is selected with **`FRANKENPHP_MODE`** (`worker` by default; set `classic` for hot-reload-friendly `Caddyfile.dev`). See [Switching classic vs worker](#switching-classic-vs-worker-frankenphp_mode).
44

55
## Worker-mode snippet
66

@@ -16,7 +16,7 @@ From `demo/symfony8/docker/frankenphp/Caddyfile`:
1616
}
1717
```
1818

19-
That is the production-style worker setup. In local dev, the demo uses `Caddyfile.dev` instead, which keeps plain `php_server` and disables cache headers.
19+
That is the default **`worker`** Caddyfile baked into the image. With `FRANKENPHP_MODE=classic`, the entrypoint switches to `Caddyfile.dev` (plain `php_server`, friendlier for file refresh).
2020

2121
## Running the demo with Symfony Beacon (direct error ingest)
2222

@@ -77,3 +77,14 @@ Its default ports are:
7777
- HTTP ingest (Docker clients / this demo): `http://localhost:9081`
7878

7979
See [`USAGE.md`](USAGE.md) for the end-to-end scenario matrix.
80+
81+
## Switching classic vs worker (`FRANKENPHP_MODE`)
82+
83+
Demos select the FrankenPHP runtime via **`FRANKENPHP_MODE`** in `.env` / `.env.example` (not a Dockerfile `ENV`):
84+
85+
| Value | Behaviour |
86+
| --- | --- |
87+
| **`worker`** (default) | Keep the worker Caddyfile (`php_server { worker ... }`) |
88+
| **`classic`** | Entrypoint copies `Caddyfile.dev` (plain `php_server`, hot-reload friendly) |
89+
90+
Compose passes `FRANKENPHP_MODE=${FRANKENPHP_MODE:-worker}` into the PHP service. After changing `.env`, run `docker compose up -d` (or `make up`) so the container is **recreated** — a plain `restart` does not reload env. No image rebuild is required.

docs/UPGRADING.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,13 @@ No consumer API or config changes. Additive only:
229229
- Optional golden Envelope contract fixtures / `make check-envelope-goldens` for maintainers aligning with Symfony Beacon ingest.
230230
- PHPUnit discovers `tests/Contract` via a dedicated testsuite.
231231

232-
## Upgrading from 1.6.1 to the next release
232+
## Upgrading from 1.6.1 to 1.6.2
233+
234+
Demo / docs only. **No consumer API or config changes.**
235+
236+
- FrankenPHP demo: set `FRANKENPHP_MODE=worker` (default) or `classic` in `demo/symfony8/.env`. After changing it, recreate containers (`docker compose up -d` / `make up`), not a plain restart.
237+
- See [DEMO-FRANKENPHP.md](DEMO-FRANKENPHP.md).
238+
239+
## Upgrading from 1.6.2 to the next release
233240

234241
No further consumer changes documented yet.

0 commit comments

Comments
 (0)