{"id":23872000,"url":"https://github.com/devgine/composer-php","last_synced_at":"2025-09-08T21:32:29.900Z","repository":{"id":169713163,"uuid":"645073957","full_name":"devgine/composer-php","owner":"devgine","description":"Docker image based on official alpine image, PHP-fpm and composer. This image will help you to build and test your PHP projects with different PHP version. It contains a necessary tools you need to analyse and test your PHP project (xdebug, phpunit, phpstan, psalm, phpcs, php-cs-fixer, phpmd, phpcpd and rector).","archived":false,"fork":false,"pushed_at":"2024-12-10T20:35:28.000Z","size":438,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-10T21:32:10.125Z","etag":null,"topics":["composer","docker","php","phpcpd","phpcsfixer","phpmd","phpstan","phpunit","rector","xdebug"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devgine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-05-24T21:39:54.000Z","updated_at":"2024-12-10T20:35:32.000Z","dependencies_parsed_at":"2024-11-27T21:21:10.410Z","dependency_job_id":"b592e3a9-7e08-4d87-aa30-d3e26f3b1ccc","html_url":"https://github.com/devgine/composer-php","commit_stats":null,"previous_names":["devgine/composer-php"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devgine%2Fcomposer-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devgine%2Fcomposer-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devgine%2Fcomposer-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devgine%2Fcomposer-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devgine","download_url":"https://codeload.github.com/devgine/composer-php/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232352927,"owners_count":18510071,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["composer","docker","php","phpcpd","phpcsfixer","phpmd","phpstan","phpunit","rector","xdebug"],"created_at":"2025-01-03T15:17:53.870Z","updated_at":"2025-01-03T15:17:54.405Z","avatar_url":"https://github.com/devgine.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Composer PHP docker image\n[![Build](https://github.com/devgine/composer-php/actions/workflows/build.yaml/badge.svg?branch=main)](https://github.com/devgine/composer-php/actions/workflows/build.yaml)\n[![License](https://img.shields.io/github/license/devgine/composer-php)](https://github.com/devgine/composer-php/blob/main/LICENSE)\n![GitHub top language](https://img.shields.io/github/languages/top/devgine/composer-php)\n[![Packages retention policy](https://github.com/devgine/composer-php/actions/workflows/packages-retention-policy.yaml/badge.svg?branch=main)](https://github.com/devgine/composer-php/actions/workflows/packages-retention-policy.yaml)\n\n![cover.png](.readme/images/cover.png)\n\n## About\nThis repository is a docker image based on official php, composer and alpine docker images to help you to build and test your PHP projects with different PHP version.\u003cbr\u003e\nThis docker image contains a necessary tools you need to analyze and test your PHP project\n* xdebug\n* phpunit\n* rector\n* phpstan\n* psalm\n* phpcs\n* php-cs-fixer\n* phpmd\n* phpcpd (available from php 7.3 version)\n\nBelow is the list of docker images available by PHP versions:\n\n| PHP version | Docker image tags                                                                        |\n|-------------|------------------------------------------------------------------------------------------|\n| PHP 8.4     | `ghcr.io/devgine/composer-php:latest`\u003cbr\u003e`ghcr.io/devgine/composer-php:v2-php8.4-alpine` |\n| PHP 8.3     | `ghcr.io/devgine/composer-php:v2-php8.3-alpine`                                          |\n| PHP 8.2     | `ghcr.io/devgine/composer-php:v2-php8.2-alpine`                                          |\n| PHP 8.1     | `ghcr.io/devgine/composer-php:v2-php8.1-alpine`                                          |\n| PHP 8.0     | `ghcr.io/devgine/composer-php:v2-php8.0-alpine`                                          |\n| PHP 7.4     | `ghcr.io/devgine/composer-php:v2-php7.4-alpine`                                          |\n| PHP 7.3     | `ghcr.io/devgine/composer-php:v2-php7.3-alpine`                                          |\n| PHP 7.2     | `ghcr.io/devgine/composer-php:v2-php7.2-alpine`                                          |\n\n\n## Usage\n### Install from the command line\n```shell\ndocker run -ti -v LOCAL_PROJECT_DIR:/var/www/composer ghcr.io/devgine/composer-php:latest sh\n```\n[All versions](https://github.com/devgine/composer-php/pkgs/container/composer-php/versions)\n### Use as base image in Dockerfile\n```dockerfile\nFROM ghcr.io/devgine/composer-php:latest\n\n# Add your custom instructions here\n# example: install bash\nRUN apk add --no-cache bash\n\n# example: expose 8080 port\nEXPOSE 8080\n#...\n```\n\n### Use components\nInside the container, you can run any tool you need from any working directory.\u003cbr\u003e\nGlobal vendor binaries are added to the PATH environment.\n\n#### Composer\n```shell\ncomposer --help\n```\n#### PHP Unit\n```shell\nsimple-phpunit --help\n```\n#### Rector\n```shell\nrector --help\n```\n#### PHPStan\n```shell\nphpstan --help\n```\n#### Psalm\n```shell\npsalm --help\n```\n#### PHP Code sniffer\n```shell\nphpcs --help\n```\n#### PHP Coding Standards Fixer\n```shell\nphp-cs-fixer --help\n```\n#### PHP Mess Detector\n```shell\nphpmd --help\n```\n#### PHP Copy Past Detector\n```shell\nphpcpd --help\n```\n\n## Use image in continuous integration\n### GitHub action\n```yaml\nname: 'Workflow name'\non:\n  push\njobs:\n  job-id:\n    runs-on: ubuntu-latest\n    ...\n    container:\n      image: ghcr.io/devgine/composer-php:latest\n    steps:\n      - name: 'Run Tests'\n        run: simple-phpunit --coverage-text\n      ...\n```\n\nAn example with matrix strategy\n```yaml\nname: 'Matrix strategy'\non:\n    push\njobs:\n  job-id:\n    runs-on: ubuntu-latest\n    ...\n    strategy:\n      fail-fast: false\n      matrix:\n        tag: ['v2-php8.3-alpine', 'v2-php8.2-alpine', 'v2-php8.1-alpine', 'v2-php8.0-alpine', 'v2-php7.4-alpine']\n    container:\n      image: ghcr.io/devgine/composer-php:${{ matrix.tag }}\n    steps:\n      - name: 'Run Tests'\n        run: simple-phpunit --coverage-text\n      ...\n```\n\n### Gitlab CI\n```yaml\ntests:\n  image: ghcr.io/devgine/composer-php:latest\n  ...\n  script:\n    - simple-phpunit --coverage-text\n```\n\nAn example with matrix strategy\n```yaml\ntests:\n  parallel:\n    matrix:\n      TAG: ['v2-php8.3-alpine', 'v2-php8.2-alpine', 'v2-php8.1-alpine', 'v2-php8.0-alpine', 'v2-php7.4-alpine']\n  image: ghcr.io/devgine/composer-php:${TAG}\n  ...\n  script:\n    - simple-phpunit --coverage-text\n```\n\n## References\n* [PHP Unit supported versions](https://phpunit.de/supported-versions.html)\n* [Xdebug compatibility](https://xdebug.org/docs/compat)\n* [PHP Unit](https://symfony.com/doc/current/components/phpunit_bridge.html)\n* [Rector](https://packagist.org/packages/rector/rector)\n* [PHPStan](https://phpstan.org/)\n* [Psalm](https://psalm.dev/docs/)\n* [PHP CS](https://github.com/squizlabs/PHP_CodeSniffer/wiki)\n* [PHP Coding Standards Fixer](https://cs.symfony.com/)\n* [PHP Mess Detector](https://phpmd.org/)\n* [PHP Copy Past detector](https://github.com/sebastianbergmann/phpcpd)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevgine%2Fcomposer-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevgine%2Fcomposer-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevgine%2Fcomposer-php/lists"}