PHP app template — z3k platform
|
|
||
|---|---|---|
| .forgejo/workflows | ||
| public | ||
| .dockerignore | ||
| Caddyfile | ||
| Dockerfile | ||
| README.md | ||
PHP template
Minimal PHP app for the z3k platform, served by FrankenPHP.
- Listens on
PORT(default8080). GET /healthreturns200 ok— used by the platform's probes.GET /greets withAPP_NAME.- Environment variables are managed in the console's Configuration tab.
Deploy
Edit the code and push to main — the platform builds the image and rolls it out. Push to deploy, that's it.
Layout
| Path | Purpose |
|---|---|
public/index.php |
App entrypoint (routes / and /health) |
Caddyfile |
FrankenPHP/Caddy config (PORT listener) |
Dockerfile |
Image build |
Why FrankenPHP
The template uses the official dunglas/frankenphp image (single binary, production-grade Caddy + PHP) instead of PHP's built-in dev server. It runs as non-root with a read-only root filesystem: all writable paths (XDG_CONFIG_HOME, XDG_DATA_HOME, TMPDIR) point under /tmp, and persist_config off / auto_https off keep Caddy from writing anywhere else. Add PHP extensions with install-php-extensions in the Dockerfile if you need them.