{"id":50978478,"url":"https://github.com/kenshodigital/frankenphp","last_synced_at":"2026-06-19T11:30:47.338Z","repository":{"id":361879412,"uuid":"1217890692","full_name":"kenshodigital/frankenphp","owner":"kenshodigital","description":"A minimal FrankenPHP image.","archived":false,"fork":false,"pushed_at":"2026-06-01T16:46:12.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-01T17:25:41.084Z","etag":null,"topics":["container","dhi","docker","frankenphp","hardened","image","php"],"latest_commit_sha":null,"homepage":"https://frankenphp.dev","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kenshodigital.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-22T10:17:40.000Z","updated_at":"2026-06-01T16:50:21.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/kenshodigital/frankenphp","commit_stats":null,"previous_names":["kenshodigital/frankenphp"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/kenshodigital/frankenphp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenshodigital%2Ffrankenphp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenshodigital%2Ffrankenphp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenshodigital%2Ffrankenphp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenshodigital%2Ffrankenphp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kenshodigital","download_url":"https://codeload.github.com/kenshodigital/frankenphp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenshodigital%2Ffrankenphp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34530296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-19T02:00:06.005Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["container","dhi","docker","frankenphp","hardened","image","php"],"created_at":"2026-06-19T11:30:46.603Z","updated_at":"2026-06-19T11:30:47.324Z","avatar_url":"https://github.com/kenshodigital.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# FrankenPHP Hardened Images\n\n[![Build][uQLTMg]][tk5Lec]\n\nThis project provides [Docker Hardened Images][bSpdG5] for [FrankenPHP][ZyMjUe].\n\nThe [build process][YmEcXD] for these images uses the same declarative YAML definition format and applies the same best practices as Docker Hardened Images. It installs pre-built upstream packages for FrankenPHP on top of a Docker hardened Alpine or Debian base.\n\n[uQLTMg]: https://github.com/kenshodigital/frankenphp/actions/workflows/build.yaml/badge.svg\n[tk5Lec]: https://github.com/kenshodigital/frankenphp/actions/workflows/build.yaml\n[bSpdG5]: https://www.docker.com/products/hardened-images/\n[ZyMjUe]: https://frankenphp.dev\n[YmEcXD]: https://docs.docker.com/dhi/how-to/build/\n\n## Using these images\n\nAll examples in this guide use the public images hosted on GitHub’s container registry.\n\n```shell\ndocker pull ghcr.io/kenshodigital/frankenphp:1-php8.5-debian\n```\n\nThe images are available in Debian and Alpine variants and are updated daily for all PHP versions that haven’t reached end of life yet.\n\nSee all [available tags and versions][eC6unD].\n\n[eC6unD]: https://github.com/kenshodigital/frankenphp/pkgs/container/frankenphp/versions?filters%5Bversion_type%5D=tagged\n\n### Exposing external ports\n\nBy default, FrankenPHP listens on port `8080` in these images. To expose this port to the host, use the `--publish` flag on `docker run`.\n\n```shell\ndocker run \\\n  --publish 8080:8080 \\\n  ghcr.io/kenshodigital/frankenphp:1-php8.5-debian\n```\n\n### Hosting a project\n\nThe default document root for FrankenPHP is `/srv/public` in these images. To host a PHP project, bind mount your application folder to `/srv` in the container.\n\n```shell\ndocker run \\\n  --publish 8080:8080 \\\n  --volume ./app:/srv:ro \\\n  ghcr.io/kenshodigital/frankenphp:1-php8.5-debian\n```\n\nAlternatively, you can use a simple Dockerfile to build a new image including your project files.\n\n```dockerfile\nFROM ghcr.io/kenshodigital/frankenphp:1-php8.5-debian\nCOPY ./app /srv\n```\n\n### Customizing configuration\n\n#### Using environment variables\n\nUse the following environment variables to customize the default server configuration.\n\n- `SERVER_NAME` to configure the hostname and/or port.\n- `SERVER_ROOT` to configure the document root.\n\n```shell\ndocker run \\\n  --env SERVER_NAME=example.com \\\n  --env SERVER_ROOT=/app/public \\\n  --publish 80:80 \\\n  --publish 443:443/tcp \\\n  --publish 443:443/udp \\\n  --volume ./app:/app:ro \\\n  ghcr.io/kenshodigital/frankenphp:1-php8.5-debian\n```\n\n#### Using a custom Caddyfile\n\nSince FrankenPHP is based on [Caddy][2nUp8C], you can also customize configuration by providing your own Caddyfile.\n\n```caddyfile\nexample.com {\n\troot /app/public\n\tencode zstd br gzip\n\tphp_server\n}\n```\n\nYou can then either bind mount your Caddyfile into the container.\n\n```shell\ndocker run \\\n  --publish 80:80 \\\n  --publish 443:443/tcp \\\n  --publish 443:443/udp \\\n  --volume ./Caddyfile:/etc/frankenphp/Caddyfile:ro \\\n  --volume ./app:/app:ro \\\n  ghcr.io/kenshodigital/frankenphp:1-php8.5-debian\n```\n\nOr build a new image including your custom configuration directly.\n\n```dockerfile\nFROM ghcr.io/kenshodigital/frankenphp:1-php8.5-debian\nCOPY ./Caddyfile /etc/frankenphp/Caddyfile\nCOPY ./app /app\n```\n\nMake sure to check out [FrankenPHP’s configuration docs][jMqJqq] as well.\n\n[2nUp8C]: https://caddyserver.com\n[jMqJqq]: https://frankenphp.dev/docs/config/\n\n### Running in read-only mode\n\nTo run these images in read-only mode, mount a Docker volume to every location where FrankenPHP writes information. In addition to the locations your application needs to be writable, FrankenPHP requires write access to `/home/frankenphp` (the home directory for the `frankenphp` user), along with a tmpfs mount for the `/tmp` directory.\n\n```shell\ndocker run \\\n  --publish 8080:8080 \\\n  --read-only \\\n  --tmpfs /tmp \\\n  --volume home:/home/frankenphp \\\n  ghcr.io/kenshodigital/frankenphp:1-php8.5-debian\n```\n\n### Customizing PHP\n\nAll runtime images include the following PHP extensions by default:\n\n- calendar\n- ctype\n- curl\n- dom\n- exif\n- fileinfo\n- filter\n- iconv\n- libxml\n- mbregex\n- mbstring\n- mysqli\n- mysqlnd\n- opcache\n- openssl\n- pcntl\n- phar\n- posix\n- session\n- shmop\n- simplexml\n- sockets\n- sodium\n- sqlite3\n- tokenizer\n- xhprof\n- xml\n- xmlreader\n- xmlwriter\n- zlib\n\nAdditional PHP extensions are available via package manager. Check out the StaticPHP packages for [Alpine][b34cMM] and [Debian][duTCWq] to see what’s supported.\n\n[b34cMM]: https://pkg.henderkes.com/85/php-zts/packages?q=php-zts-\u0026type=alpine\n[duTCWq]: https://pkg.henderkes.com/85/php-zts/packages?q=php-zts-\u0026type=debian\n\n#### Using dev variants\n\nEach runtime image comes with a corresponding dev variant including a package manager, [Composer][Et32Qb], [PIE][wZqJSj], and [Xdebug][uXy47d]. You can use these images in a multi-stage build to install additional PHP extensions and run CLI tasks.\n\n```dockerfile\nFROM ghcr.io/kenshodigital/frankenphp:1-php8.5-alpine-dev AS builder\nRUN apk update\nRUN apk add php-zts-gd\nCOPY ./app /srv\nRUN composer install --no-interaction --no-dev --optimize-autoloader\n\nFROM ghcr.io/kenshodigital/frankenphp:1-php8.5-alpine\nCOPY --from=builder /etc/php-zts/conf.d/20-gd.ini /etc/php-zts/conf.d/20-gd.ini\nCOPY --from=builder /usr/lib/php-zts/modules/gd-zts-85.so /usr/lib/php-zts/modules/gd-zts-85.so\nCOPY --from=builder /srv /srv\n```\n\n[Et32Qb]: https://getcomposer.org\n[wZqJSj]: https://github.com/php/pie\n[uXy47d]: https://xdebug.org\n\n#### Building your own\n\nAlternatively, you can build your own Docker Hardened Images directly by copying a definition file and adding additional packages from the StaticPHP repository.\n\n```yaml\npackages:\n  - alpine-baselayout-data\n  - busybox\n  - ca-certificates-bundle\n  - frankenphp\n  - php-zts-bcmath\n  - php-zts-embed\n  - php-zts-gd\n  - php-zts-pdo\n  - php-zts-pdo_sqlite\n  - tzdata\n```\n\nThen build your custom image.\n\n```shell\ndocker buildx build . \\\n  --file image/1-php8.5-alpine3.23.yaml \\\n  --load \\\n  --provenance=1 \\\n  --sbom=generator=dhi.io/scout-sbom-indexer:1 \\\n  --tag frankenphp:1-php8.5-alpine-custom\n```\n\n##### Requirements\n\nYou need to be signed in to a Docker account to pull base images and packages from dhi.io to build your own Docker Hardened Images.\n\n## Troubleshooting\n\n### Debugging\n\nHardened images intended for runtime usually don’t contain a shell or debugging tools. Use Docker Debug to attach to these containers for debugging.\n\n### Permissions\n\nImage variants intended for runtime run as `frankenphp` user by default. Ensure that necessary files and directories are accessible to this user with the required permissions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenshodigital%2Ffrankenphp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkenshodigital%2Ffrankenphp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenshodigital%2Ffrankenphp/lists"}