PHP app template — z3k platform
Find a file Use this template
Arthur Zinck c27eb03215
Some checks failed
build-image / build (push) Failing after 2s
ci: preview build on pull requests
2026-07-27 11:51:39 +00:00
.forgejo/workflows ci: preview build on pull requests 2026-07-27 11:51:39 +00:00
public feat: php template — public/index.php 2026-07-26 20:10:47 +00:00
.dockerignore feat: php template — .dockerignore 2026-07-26 20:10:49 +00:00
Caddyfile feat: php template — Caddyfile 2026-07-26 20:10:48 +00:00
Dockerfile feat: platform base images (z3k-images) 2026-07-27 07:13:47 +00:00
README.md feat: php template — README.md 2026-07-26 20:10:50 +00:00

PHP template

Minimal PHP app for the z3k platform, served by FrankenPHP.

  • Listens on PORT (default 8080).
  • GET /health returns 200 ok — used by the platform's probes.
  • GET / greets with APP_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.