{"id":26572395,"url":"https://github.com/matchory/docker-php","last_synced_at":"2026-04-08T16:31:28.252Z","repository":{"id":282742663,"uuid":"949028398","full_name":"matchory/docker-php","owner":"matchory","description":"The Docker base image for Matchory applications running on the PHP runtime.","archived":false,"fork":false,"pushed_at":"2025-11-27T07:32:07.000Z","size":158,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-30T01:27:45.151Z","etag":null,"topics":["base-image","docker","docker-image","frankenphp","php"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","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/matchory.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":"2025-03-15T14:10:32.000Z","updated_at":"2025-11-27T07:32:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"c312f0f7-a01e-45f0-96f0-ff9f7795e08a","html_url":"https://github.com/matchory/docker-php","commit_stats":null,"previous_names":["matchory/docker-php"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/matchory/docker-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matchory%2Fdocker-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matchory%2Fdocker-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matchory%2Fdocker-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matchory%2Fdocker-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matchory","download_url":"https://codeload.github.com/matchory/docker-php/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matchory%2Fdocker-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31564832,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["base-image","docker","docker-image","frankenphp","php"],"created_at":"2025-03-23T00:33:55.219Z","updated_at":"2026-04-08T16:31:28.241Z","avatar_url":"https://github.com/matchory.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"Docker PHP Base Images\n======================\n\nThis repository contains the Dockerfiles for the PHP base images used by Matchory web applications. Images are published\nto `ghcr.io/matchory/php`.\n\n## Image Variants\n\n| Variant        | Dockerfile              | Base Image           | Use Case                                    |\n|----------------|-------------------------|----------------------|---------------------------------------------|\n| **Standard**   | `Dockerfile`            | `php:*-cli` (Debian) | Default CLI image                           |\n| **Alpine**     | `alpine.Dockerfile`     | `php:*-cli-alpine`   | Smaller image size                          |\n| **FrankenPHP** | `frankenphp.Dockerfile` | `dunglas/frankenphp` | Web server with Caddy, Mercure, and Vulcain |\n\nEach variant provides two build targets:\n\n- **`dev`** — Includes Xdebug and Composer\n- **`prod`** — Stripped-down, built `FROM scratch` for minimal size\n\n## Quick Start\n\n```bash\n# Standard Debian image\ndocker build --target dev -t php:dev .\ndocker build --target prod -t php:prod .\n\n# Alpine variant\ndocker build --target dev -f alpine.Dockerfile -t php:alpine-dev .\n\n# FrankenPHP variant\ndocker build --target dev -f frankenphp.Dockerfile -t php:frankenphp-dev .\n\n# Specify PHP version (default: 8.4)\ndocker build --build-arg PHP_VERSION=8.5 --target dev -t php:8.5-dev .\n```\n\n## Pre-installed Extensions\n\n**Via PIE/PECL:**\nredis, apcu, yaml, memcached (with session and JSON support), excimer, uv\n\n**Swoole** (PHP 8.4 only): Compiled with curl, pgsql, sqlite, sockets, openssl, iouring, and brotli support.\n\n**Built-in PHP extensions:**\npdo_sqlite, pdo_pgsql, sockets, bcmath, pcntl, intl, zip, opcache\n\n**Dev target only:**\nXdebug, Composer\n\n## Environment Variables\n\n### PHP Configuration\n\n| Variable                  | Default        | Description                  |\n|---------------------------|----------------|------------------------------|\n| `PHP_MEMORY_LIMIT`        | `2G`           | Memory limit                 |\n| `PHP_MAX_EXECUTION_TIME`  | `300`          | Max execution time (seconds) |\n| `PHP_UPLOAD_MAX_FILESIZE` | `128M`         | Max upload file size         |\n| `PHP_POST_MAX_SIZE`       | Same as upload | Max POST body size           |\n| `PHP_ERROR_REPORTING`     | `E_ALL`        | Error reporting level        |\n\n### OPcache\n\n| Variable                            | Default (dev / prod) | Description                  |\n|-------------------------------------|----------------------|------------------------------|\n| `PHP_OPCACHE_ENABLE`                | `1`                  | Enable OPcache               |\n| `PHP_OPCACHE_ENABLE_CLI`            | Same as enable       | Enable OPcache for CLI       |\n| `PHP_OPCACHE_VALIDATE_TIMESTAMPS`   | `1` / `0`            | Revalidate scripts on change |\n| `PHP_OPCACHE_MAX_ACCELERATED_FILES` | `10000`              | Max cached scripts           |\n| `PHP_OPCACHE_MEMORY_CONSUMPTION`    | `192`                | OPcache memory (MB)          |\n| `PHP_OPCACHE_MAX_WASTED_PERCENTAGE` | `10`                 | Restart threshold (%)        |\n\n### FrankenPHP-specific\n\nThe FrankenPHP variant uses a Caddyfile with Mercure and Vulcain enabled. Configure via:\n\n| Variable                        | Default                   | Description                              |\n|---------------------------------|---------------------------|------------------------------------------|\n| `SERVER_NAME`                   | `localhost`               | Server hostname                          |\n| `MERCURE_TRANSPORT_URL`         | `bolt:///data/mercure.db` | Mercure transport backend                |\n| `MERCURE_PUBLISHER_JWT_KEY`     | —                         | JWT key for publishers                   |\n| `MERCURE_SUBSCRIBER_JWT_KEY`    | —                         | JWT key for subscribers                  |\n| `CADDY_GLOBAL_OPTIONS`          | —                         | Additional Caddy global config           |\n| `CADDY_EXTRA_CONFIG`            | —                         | Additional Caddy site blocks             |\n| `CADDY_SERVER_EXTRA_DIRECTIVES` | —                         | Extra directives inside the server block |\n| `FRANKENPHP_CONFIG`             | —                         | Extra FrankenPHP directives              |\n\n## Build Args\n\n| Arg           | Default | Description                   |\n|---------------|---------|-------------------------------|\n| `PHP_VERSION` | `8.4`   | PHP version (`8.4`, `8.5`)    |\n| `user`        | `php`   | Non-root username             |\n| `uid`         | `900`   | UID/GID for the non-root user |\n\n## Non-root User\n\nAll images create and run as user `php` (UID 900) by default. Override with the `user` and `uid` build args.\n\n## Multi-stage Build Architecture\n\nAll Dockerfiles follow a consistent pattern:\n\n1. **pie** — PIE (PHP Installer for Extensions) binary\n2. **upstream** — Base PHP image with runtime dependencies\n3. **builder** — Compiles PHP extensions (Debian variants) or included in base (Alpine)\n4. **base** — Non-root user setup, copies compiled extensions and custom `php.ini`\n5. **dev** — Adds Xdebug and Composer on top of base\n6. **prod-pre** — Strips build tools, dev packages, and caches\n7. **prod** — `FROM scratch` with only the final filesystem for minimal image size\n\n## CI/CD\n\nGitHub Actions builds and pushes all variants on:\n\n- **Push to `main`** — Always builds\n- **Weekly schedule** (Mondays 03:00 UTC) — Only rebuilds if upstream base images have changed\n\nImages are built for `linux/amd64` and `linux/arm64`, with SBOM and provenance attestations.\n\n### Image Tags\n\nImages are tagged as:\n\n```\nghcr.io/matchory/php:\u003cversion\u003e[-\u003cvariant\u003e][-dev]\n```\n\nExamples:\n\n- `ghcr.io/matchory/php:8.4` — Standard Debian, production\n- `ghcr.io/matchory/php:8.4-dev` — Standard Debian, development\n- `ghcr.io/matchory/php:8.4-alpine` — Alpine, production\n- `ghcr.io/matchory/php:8.4-alpine-dev` — Alpine, development\n- `ghcr.io/matchory/php:8.4-frankenphp` — FrankenPHP, production\n- `ghcr.io/matchory/php:8.4-frankenphp-dev` — FrankenPHP, development\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatchory%2Fdocker-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatchory%2Fdocker-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatchory%2Fdocker-php/lists"}