{"id":26479449,"url":"https://github.com/soifou/php-alpine","last_synced_at":"2026-03-01T19:02:04.722Z","repository":{"id":81725785,"uuid":"65033384","full_name":"soifou/php-alpine","owner":"soifou","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-01T11:47:07.000Z","size":80,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-05T17:24:19.273Z","etag":null,"topics":["alpine-linux","dockerfile","php-cli","php-fpm"],"latest_commit_sha":null,"homepage":null,"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/soifou.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}},"created_at":"2016-08-05T16:30:15.000Z","updated_at":"2025-03-01T11:47:11.000Z","dependencies_parsed_at":"2024-02-20T18:43:31.829Z","dependency_job_id":"839268d1-204f-47c5-9c88-b0b90956ee63","html_url":"https://github.com/soifou/php-alpine","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/soifou/php-alpine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soifou%2Fphp-alpine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soifou%2Fphp-alpine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soifou%2Fphp-alpine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soifou%2Fphp-alpine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/soifou","download_url":"https://codeload.github.com/soifou/php-alpine/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soifou%2Fphp-alpine/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29980795,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T16:35:47.903Z","status":"ssl_error","status_checked_at":"2026-03-01T16:35:44.899Z","response_time":124,"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":["alpine-linux","dockerfile","php-cli","php-fpm"],"created_at":"2025-03-20T01:55:11.378Z","updated_at":"2026-03-01T19:02:04.707Z","avatar_url":"https://github.com/soifou.png","language":"Dockerfile","readme":"# PHP CLI/FPM on Alpine Linux\n\nAlpine Linux built with common [PHP extensions](./cli/packages) and\n[Image Magick](https://github.com/ImageMagick/ImageMagick).\n\n## Install\n\nGit clone the repository then build the desired image.\n\n```sh\ngit clone https://github.com/soifou/php-alpine\ncd php-alpine\nmake build\n```\n\nSee the provided [Makefile](./Makefile) to know how and what to build. You need\nat least the \"base\" version in order to build a variant. Why is that? Because\nthis considerably speedup the build process.\n\nEg. `cli-8.3-whktmltopdf` depends on `cli-8.3` and so on.\n\n## Tags\n\nVersions and tags are based on PHP 5.x, 7.x and 8.x versions.\n\n- `cli` tag is designed to be used for command line stuff\n- `fpm` tag is designed to be used with PHP-FPM (and fits very well with an\n  Alpine/Nginx docker image).\n\n| cli       | fpm       |\n| --------- | --------- |\n| `cli-8.3` | `fpm-8.3` |\n| `cli-8.2` | `fpm-8.2` |\n| `cli-8.1` | `fpm-8.1` |\n| `cli-8.0` | `fpm-8.0` |\n| `cli-7.4` | `fpm-7.4` |\n| `cli-7.3` | `fpm-7.3` |\n| `cli-7.2` | `fpm-7.2` |\n| `cli-7.1` | `fpm-7.1` |\n| `cli-7.0` | `fpm-7.0` |\n| `cli-5.6` | `fpm-5.6` |\n\n- `wkhtmltopdf` variant embarks the\n  [docker-alpine-wkhtmltopdf](https://github.com/madnight/docker-alpine-wkhtmltopdf),\n  the size of the image then increases aproximately to 100MB.\n- `composer` variant include [php composer](https://getcomposer.org)\n\n| cli-composer       | cli-wkhtmltopdf       | fpm-wkhtmltopdf       |\n| ------------------ | --------------------- | --------------------- |\n| `cli-8.3-composer` | `cli-8.3-wkhtmltopdf` | `fpm-8.3-wkhtmltopdf` |\n| `cli-8.2-composer` | `cli-8.2-wkhtmltopdf` | `fpm-8.2-wkhtmltopdf` |\n| `cli-8.1-composer` | `cli-8.1-wkhtmltopdf` | `fpm-8.1-wkhtmltopdf` |\n\n## Wkhtmltopdf variant\n\nTo use wkhtmltopdf inside a docker app, you'll need to set the hostname of the\napp in the php container because wkhtmltopdf need to fetch some assets for\nrendering.\n\n```yaml\n---\nnetworks:\n    lamp-network:\n        name: lamp-network\n        ipam:\n            driver: default\n            config:\n                - subnet: \"172.18.0.0/24\"\nservices:\n    web:\n        image: nginx:1.19-alpine\n        ...\n        networks:\n            lamp-network:\n                ipv4_address: 172.18.0.6\n\n    php:\n        image: soifou/php-alpine:fpm-8.2-wkhtmltopdf\n        ...\n        networks:\n            - lamp-network\n        extra_hosts:\n            # wkhtmltopdf need to know the hostname to fetch assets\n            - website.org:172.18.0.6\n```\n\n## Composer variant\n\n```sh\ncomposer() {\n    tty=\n    tty -s \u0026\u0026 tty=--tty\n    docker run \\\n        $tty \\\n        --interactive \\\n        --rm \\\n        -u $(id -u):$(id -g) \\\n        --env COMPOSER_HOME=/composer \\\n        -v $COMPOSER_HOME:/composer \\\n        --env COMPOSER_CACHE_DIR=/composer/cache \\\n        -v $COMPOSER_CACHE_DIR:/composer/cache \\\n        -v /etc/passwd:/etc/passwd:ro \\\n        -v /etc/group:/etc/group:ro \\\n        -v $(pwd):/app \\\n        --env SSH_AUTH_SOCK=/ssh-auth.sock \\\n        -v $SSH_AUTH_SOCK:/ssh-auth.sock \\\n        --net=$DOCKER_NETWORK_NAME \\\n        soifou/php-alpine:cli-${PHP_VERSION:-8.2}-composer ${@:1}\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoifou%2Fphp-alpine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoifou%2Fphp-alpine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoifou%2Fphp-alpine/lists"}