FrankenPHP Docker image setup for dev/prod #3

Closed
opened 2026-09-01 19:28:04 +00:00 by haylan · 1 comment
Owner

Part of #1

Question

What does a FrankenPHP-based Symfony Docker setup need for this project: base image/tag to pin, required PHP extensions (pdo_sqlite, sodium for the secrets vault per docs/research/smart-tablet-screen-config-secrets.md, others Symfony needs), the split between a dev image (used to build/run locally) and a prod image (multi-stage build, Caddy/FrankenPHP prod mode), and the docker-compose.yml + docker-compose.override.yml shape for local dev — single Symfony service, SQLite on a named var/ volume, no reverse proxy (stays external on the host per this map's Notes).

Part of #1 ## Question What does a FrankenPHP-based Symfony Docker setup need for this project: base image/tag to pin, required PHP extensions (pdo_sqlite, sodium for the secrets vault per docs/research/smart-tablet-screen-config-secrets.md, others Symfony needs), the split between a dev image (used to build/run locally) and a prod image (multi-stage build, Caddy/FrankenPHP prod mode), and the docker-compose.yml + docker-compose.override.yml shape for local dev — single Symfony service, SQLite on a named var/ volume, no reverse proxy (stays external on the host per this map's Notes).
haylan added the wayfinder:research label 2026-09-01 19:28:25 +00:00
Author
Owner

Researched against FrankenPHP's own docs, GitHub repos, and Docker Hub — findings in docs/research/smart-tablet-screen-frankenphp-docker.md.

  • Base image: dunglas/frankenphp:1-php8.5 (Debian-based, per frankenphp.dev's own recommendation over Alpine).
  • FrankenPHP's Symfony guide (frankenphp.dev/docs/symfony/) recommends dunglas/symfony-docker as the reference Dockerfile: a 3-stage build (shared base -> dev with Xdebug/watch -> prod builder + minimal final stage).
  • Worker mode (keep-app-booted-in-memory) is natively supported since Symfony 7.4, but the reference implementation leaves it OFF by default in prod (only enabled in dev via FRANKENPHP_WORKER_CONFIG=watch) since it requires auditing app code for per-request state leaks first.
  • pdo_sqlite and sodium are both already enabled by default in dunglas/frankenphp:1-php8.5 (verified by actually running the image) - no install-php-extensions step is strictly required, though I recommend listing them explicitly as documentation.
  • Recommended compose shape: base docker-compose.yml (prod-shaped, no reverse proxy per the map's decision) + docker-compose.override.yaml for dev (bind-mount source, dev build target, env overrides), with a named var/ volume (not an anonymous one) so the SQLite cache persists across rebuilds.

Full illustrative Dockerfile/compose snippets are in the doc's Recommended approach section.

Researched against FrankenPHP's own docs, GitHub repos, and Docker Hub — findings in docs/research/smart-tablet-screen-frankenphp-docker.md. - Base image: dunglas/frankenphp:1-php8.5 (Debian-based, per frankenphp.dev's own recommendation over Alpine). - FrankenPHP's Symfony guide (frankenphp.dev/docs/symfony/) recommends dunglas/symfony-docker as the reference Dockerfile: a 3-stage build (shared base -> dev with Xdebug/watch -> prod builder + minimal final stage). - Worker mode (keep-app-booted-in-memory) is natively supported since Symfony 7.4, but the reference implementation leaves it OFF by default in prod (only enabled in dev via FRANKENPHP_WORKER_CONFIG=watch) since it requires auditing app code for per-request state leaks first. - pdo_sqlite and sodium are both already enabled by default in dunglas/frankenphp:1-php8.5 (verified by actually running the image) - no install-php-extensions step is strictly required, though I recommend listing them explicitly as documentation. - Recommended compose shape: base docker-compose.yml (prod-shaped, no reverse proxy per the map's decision) + docker-compose.override.yaml for dev (bind-mount source, dev build target, env overrides), with a named var/ volume (not an anonymous one) so the SQLite cache persists across rebuilds. Full illustrative Dockerfile/compose snippets are in the doc's Recommended approach section.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: haylan/Smart-Tablet-Screen#3