{"id":13549966,"url":"https://github.com/edbizarro/gitlab-ci-pipeline-php","last_synced_at":"2025-04-04T16:14:34.167Z","repository":{"id":49074545,"uuid":"82475904","full_name":"edbizarro/gitlab-ci-pipeline-php","owner":"edbizarro","description":":coffee: Docker images for test PHP applications with Gitlab CI (or any other CI platform!)","archived":false,"fork":false,"pushed_at":"2021-06-29T13:12:12.000Z","size":826,"stargazers_count":525,"open_issues_count":31,"forks_count":165,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-04-04T04:32:20.886Z","etag":null,"topics":["cd","ci","continuous-delivery","continuous-integration","docker","docker-images","gitlab","gitlab-ci","hacktoberfest","laravel-dusk","php","test-laravel"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/edbizarro/gitlab-ci-pipeline-php","language":"Shell","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/edbizarro.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}},"created_at":"2017-02-19T17:19:55.000Z","updated_at":"2025-04-02T14:22:11.000Z","dependencies_parsed_at":"2022-08-25T08:21:08.471Z","dependency_job_id":null,"html_url":"https://github.com/edbizarro/gitlab-ci-pipeline-php","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edbizarro%2Fgitlab-ci-pipeline-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edbizarro%2Fgitlab-ci-pipeline-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edbizarro%2Fgitlab-ci-pipeline-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edbizarro%2Fgitlab-ci-pipeline-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edbizarro","download_url":"https://codeload.github.com/edbizarro/gitlab-ci-pipeline-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247208145,"owners_count":20901570,"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":["cd","ci","continuous-delivery","continuous-integration","docker","docker-images","gitlab","gitlab-ci","hacktoberfest","laravel-dusk","php","test-laravel"],"created_at":"2024-08-01T12:01:27.535Z","updated_at":"2025-04-04T16:14:34.145Z","avatar_url":"https://github.com/edbizarro.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# Build and test PHP applications with Gitlab CI (or any other CI platform)\n\n\u003e Docker images with everything you'll need to build and test PHP applications.\n\n![Logo](https://raw.githubusercontent.com/edbizarro/gitlab-ci-pipeline-php/master/gitlab-ci-pipeline-php.png)\n\n---\n![GitHub last commit](https://img.shields.io/github/last-commit/edbizarro/gitlab-ci-pipeline-php.svg?style=for-the-badge\u0026logo=git) [![Docker Pulls](https://img.shields.io/docker/pulls/edbizarro/gitlab-ci-pipeline-php.svg?style=for-the-badge\u0026logo=docker)](https://hub.docker.com/r/edbizarro/gitlab-ci-pipeline-php/) [![building status](https://gitlab.com/edbizarro/gitlab-ci-pipeline-php/badges/master/pipeline.svg)](https://gitlab.com/edbizarro/gitlab-ci-pipeline-php/commits/master)\n\n---\n\n## Based on [Official PHP images](https://hub.docker.com/_/php/)\n\n\u003e PHP 8.0 available!\n\n- ```8.0```, ```8```, ```latest``` [(8.0/Dockerfile)](https://github.com/edbizarro/gitlab-ci-pipeline-php/blob/master/php/8.0/Dockerfile) - [![](https://images.microbadger.com/badges/image/edbizarro/gitlab-ci-pipeline-php:8.0.svg)](https://microbadger.com/images/edbizarro/gitlab-ci-pipeline-php:8.0 \"Get your own image badge on microbadger.com\")\n\n- ```8.0-alpine```, ```alpine``` [(8.0/alpine/Dockerfile)](https://github.com/edbizarro/gitlab-ci-pipeline-php/blob/master/php/8.0/alpine/Dockerfile) - [![](https://images.microbadger.com/badges/image/edbizarro/gitlab-ci-pipeline-php:8.0-alpine.svg)](https://microbadger.com/images/edbizarro/gitlab-ci-pipeline-php:8.0-alpine \"Get your own image badge on microbadger.com\")\n\n\n- ```8.0-fpm```, ```fpm``` [(8.0/fpm/Dockerfile)](https://github.com/edbizarro/gitlab-ci-pipeline-php/blob/master/php/8.0/fpm/Dockerfile) - [![](https://images.microbadger.com/badges/image/edbizarro/gitlab-ci-pipeline-php:8.0-fpm.svg)](https://microbadger.com/images/edbizarro/gitlab-ci-pipeline-php:8.0-fpm \"Get your own image badge on microbadger.com\")\n\n- ```7.4```, ```7``` [(7.4/Dockerfile)](https://github.com/edbizarro/gitlab-ci-pipeline-php/blob/master/php/7.4/Dockerfile) - [![](https://images.microbadger.com/badges/image/edbizarro/gitlab-ci-pipeline-php:7.4.svg)](https://microbadger.com/images/edbizarro/gitlab-ci-pipeline-php:7.4 \"Get your own image badge on microbadger.com\")\n\n- ```7.4-alpine```, ```alpine``` [(7.4/alpine/Dockerfile)](https://github.com/edbizarro/gitlab-ci-pipeline-php/blob/master/php/7.4/alpine/Dockerfile) - [![](https://images.microbadger.com/badges/image/edbizarro/gitlab-ci-pipeline-php:7.4-alpine.svg)](https://microbadger.com/images/edbizarro/gitlab-ci-pipeline-php:7.4-alpine \"Get your own image badge on microbadger.com\")\n\n\n- ```7.4-fpm```, ```fpm``` [(7.4/fpm/Dockerfile)](https://github.com/edbizarro/gitlab-ci-pipeline-php/blob/master/php/7.4/fpm/Dockerfile) - [![](https://images.microbadger.com/badges/image/edbizarro/gitlab-ci-pipeline-php:7.4-fpm.svg)](https://microbadger.com/images/edbizarro/gitlab-ci-pipeline-php:7.4-fpm \"Get your own image badge on microbadger.com\")\n\n- ```7.3``` [(7.3/Dockerfile)](https://github.com/edbizarro/gitlab-ci-pipeline-php/blob/master/php/7.3/Dockerfile) - [![](https://images.microbadger.com/badges/image/edbizarro/gitlab-ci-pipeline-php:7.3.svg)](https://microbadger.com/images/edbizarro/gitlab-ci-pipeline-php:7.3 \"Get your own image badge on microbadger.com\")\n\n- ```7.3-alpine``` [(7.3/alpine/Dockerfile)](https://github.com/edbizarro/gitlab-ci-pipeline-php/blob/master/php/7.3/alpine/Dockerfile) - [![](https://images.microbadger.com/badges/image/edbizarro/gitlab-ci-pipeline-php:7.3-alpine.svg)](https://microbadger.com/images/edbizarro/gitlab-ci-pipeline-php:7.3-alpine \"Get your own image badge on microbadger.com\")\n\n- ```7.3-alpine-lts```, ```alpine-lts``` [(7.3/alpine/Dockerfile-lts)](https://github.com/edbizarro/gitlab-ci-pipeline-php/blob/master/php/7.3/alpine/Dockerfile-lts) - [![](https://images.microbadger.com/badges/image/edbizarro/gitlab-ci-pipeline-php:7.3-alpine-lts.svg)](https://microbadger.com/images/edbizarro/gitlab-ci-pipeline-php:7.3-alpine-lts \"Get your own image badge on microbadger.com\")\n\n- ```7.3-fpm``` [(7.3/fpm/Dockerfile)](https://github.com/edbizarro/gitlab-ci-pipeline-php/blob/master/php/7.3/fpm/Dockerfile) - [![](https://images.microbadger.com/badges/image/edbizarro/gitlab-ci-pipeline-php:7.3-fpm.svg)](https://microbadger.com/images/edbizarro/gitlab-ci-pipeline-php:7.3-fpm \"Get your own image badge on microbadger.com\")\n\nAll versions come with [Node 14](https://nodejs.org/en/), [Composer](https://getcomposer.org/) and [Yarn](https://yarnpkg.com)\n\n\u003e PHP 7.0.x, 7.1.x and PHP 7.2.x are now deprecated and removed from this repo since they reach end of life. Your scripts will not stop working since the images are still available but they will not be receiving new builds from now on. For more information please visit https://www.php.net/supported-versions.php\n\n---\n\n## Laravel projects\n\nAll images come with PHP (with all laravel required extensions), Composer (with [hirak/prestissimo](https://github.com/hirak/prestissimo) to speed up installs), Node and [Yarn](https://yarnpkg.com).\n\nEverything you need to test Laravel projects :D\n\n### Laravel Dusk\n\nTo run Dusk tests we need chromium installed on the image, because of that we have a special tag for this case.\n\n- ```8.0-chromium``` [(8.0/chromium/Dockerfile)](https://github.com/edbizarro/gitlab-ci-pipeline-php/blob/master/php/8.0/chromium/Dockerfile) [![](https://images.microbadger.com/badges/image/edbizarro/gitlab-ci-pipeline-php:8.0-chromium.svg)](https://microbadger.com/images/edbizarro/gitlab-ci-pipeline-php:8.0-chromium \"Get your own image badge on microbadger.com\")\n- ```7.4-chromium``` [(7.4/chromium/Dockerfile)](https://github.com/edbizarro/gitlab-ci-pipeline-php/blob/master/php/7.4/chromium/Dockerfile) [![](https://images.microbadger.com/badges/image/edbizarro/gitlab-ci-pipeline-php:7.4-chromium.svg)](https://microbadger.com/images/edbizarro/gitlab-ci-pipeline-php:7.4-chromium \"Get your own image badge on microbadger.com\")\n- ```7.3-chromium``` [(7.3/chromium/Dockerfile)](https://github.com/edbizarro/gitlab-ci-pipeline-php/blob/master/php/7.3/chromium/Dockerfile) [![](https://images.microbadger.com/badges/image/edbizarro/gitlab-ci-pipeline-php:7.3-chromium.svg)](https://microbadger.com/images/edbizarro/gitlab-ci-pipeline-php:7.3-chromium \"Get your own image badge on microbadger.com\")\n\nCheck *Dusk example* for more details.\n\n---\n\n## Gitlab pipeline examples\n\n### Laravel test examples\n\n#### Simple ```.gitlab-ci.yml``` using mysql service\n\n```yaml\n# Variables\nvariables:\n  MYSQL_ROOT_PASSWORD: root\n  MYSQL_USER: homestead\n  MYSQL_PASSWORD: secret\n  MYSQL_DATABASE: homestead\n  DB_HOST: mysql\n\ntest:\n  stage: test\n  services:\n    - mysql:5.7\n  image: edbizarro/gitlab-ci-pipeline-php:8.0-alpine\n  script:\n    - yarn install --pure-lockfile\n    - composer install --prefer-dist --no-ansi --no-interaction --no-progress\n    - cp .env.example .env\n    - php artisan key:generate\n    - php artisan migrate:refresh --seed\n    - ./vendor/phpunit/phpunit/phpunit -v --coverage-text --colors=never --stderr\n```\n\n#### Advanced ```.gitlab-ci.yml``` using mysql service, stages and cache\n\n```yaml\nstages:\n  - test\n  - deploy\n\n# Variables\nvariables:\n  MYSQL_ROOT_PASSWORD: root\n  MYSQL_USER: homestead\n  MYSQL_PASSWORD: secret\n  MYSQL_DATABASE: homestead\n  DB_HOST: mysql\n\n# Speed up builds\ncache:\n  key: $CI_BUILD_REF_NAME # changed to $CI_COMMIT_REF_NAME in Gitlab 9.x\n  paths:\n    - vendor\n    - node_modules\n    - public\n    - .yarn\n\n\ntest:\n  stage: test\n  services:\n    - mysql:5.7\n  image: edbizarro/gitlab-ci-pipeline-php:8.0-alpine\n  script:\n    - yarn config set cache-folder .yarn\n    - yarn install --pure-lockfile\n    - composer install --prefer-dist --no-ansi --no-interaction --no-progress\n    - cp .env.example .env\n    - php artisan key:generate\n    - php artisan migrate:refresh --seed\n    - ./vendor/phpunit/phpunit/phpunit -v --coverage-text --colors=never --stderr\n  artifacts:\n    paths:\n      - ./storage/logs # for debugging\n    expire_in: 7 days\n    when: always\n\ndeploy:\n  stage: deploy\n  image: edbizarro/gitlab-ci-pipeline-php:8.0-alpine\n  script:\n    - echo \"Deploy all the things!\"\n  only:\n    - master\n  when: on_success\n```\n\n#### Laravel Dusk tests ```.gitlab-ci.yml``` using mysql service and cache\n\n```yaml\nstages:\n  - test\n\n# Variables\nvariables:\n  MYSQL_ROOT_PASSWORD: root\n  MYSQL_USER: homestead\n  MYSQL_PASSWORD: secret\n  MYSQL_DATABASE: homestead\n  DB_HOST: mysql\n\n# Speed up builds\ncache:\n  key: $CI_BUILD_REF_NAME # changed to $CI_COMMIT_REF_NAME in Gitlab 9.x\n  paths:\n    - vendor\n    - node_modules\n    - public\n    - .yarn\n\n\ntest:\n  stage: test\n  services:\n    - mysql:5.7\n  image: edbizarro/gitlab-ci-pipeline-php:8.0-chromium\n  script:\n    - yarn config set cache-folder .yarn\n    - yarn install --pure-lockfile\n    - composer install --prefer-dist --no-ansi --no-interaction --no-progress\n    - cp .env.example .env\n    - php artisan key:generate\n    - php artisan migrate:refresh --seed\n    - php artisan serve \u0026\n    - ./vendor/laravel/dusk/bin/chromedriver-linux --port=9515 \u0026\n    - sleep 5\n    - php artisan dusk\n  artifacts:\n    paths:\n      - ./storage/logs # for debugging\n      - ./tests/Browser/screenshots # for Dusk screenshots\n      - ./tests/Browser/console\n    expire_in: 7 days\n    when: always\n```\n---\n\n## Deploying Laravel applications with Gitlab\n\nRecommended\n\n- [Deployer](https://deployer.org/blog/how-to-deploy-laravel)\n- [Envoyer](https://envoyer.io)\n\n---\n\nSpecial thanks to [Ambientum](https://github.com/codecasts/ambientum), an incredible Brazilian project, for the inspiration.\n\n[![forthebadge](https://forthebadge.com/images/badges/60-percent-of-the-time-works-every-time.svg)](https://forthebadge.com)\n[![forthebadge](https://forthebadge.com/images/badges/contains-cat-gifs.svg)](https://forthebadge.com)\n[![forthebadge](http://forthebadge.com/images/badges/built-by-developers.svg)](http://forthebadge.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedbizarro%2Fgitlab-ci-pipeline-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedbizarro%2Fgitlab-ci-pipeline-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedbizarro%2Fgitlab-ci-pipeline-php/lists"}