Docker images with everything you'll need to build and test PHP applications.
4.1K
This repository was created because the original repository is no longer maintained. It is not only suitable for laravel projects, but also enables all PHP projects to get started quickly and easily. All images are ideal for running PHPUnit test cases via Github, Bibucket or GItlab pipelines. Thanks to chronium, GUI test cases are also possible.
Have fun!
Docker images with everything you'll need to build and test PHP applications.

PHP 8.2 now available!
8.2, latest (8.2/Dockerfile)
8.1 (8.1/Dockerfile
8.0, 8 (8.0/Dockerfile)
7.4, 7 (7.4/Dockerfile)
7.4-fpm (7.4/fpm/Dockerfile)
8.0-fpm (8.0/fpm/Dockerfile)
8.1-fpm (8.1/fpm/Dockerfile)
8.2-fpm (8.2/fpm/Dockerfile)
7.4-alpine (7.4/alpine/Dockerfile)
8.0-alpine (8.0/alpine/Dockerfile)
8.1-alpine (8.1/alpine/Dockerfile)
8.2-alpine (8.2/alpine/Dockerfile)
All versions come with Node 16, Composer and Yarn
PHP 7.0.x, 7.1.x, PHP 7.2.x and PHP 7.3.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
All images come with PHP (with all laravel required extensions), Composer, Node and Yarn.
Everything you need to test Laravel projects :D
To run Dusk tests we need chromium installed on the image, because of that we have a special tag for this case.
7.4-chromium (7.4/chromium/Dockerfile)8.0-chromium (8.0/chromium/Dockerfile)8.1-chromium (8.1/chromium/Dockerfile)8.2-chromium (8.2/chromium/Dockerfile)Check Dusk example for more details.
.gitlab-ci.yml using mysql service# Variables
variables:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: homestead
MYSQL_PASSWORD: secret
MYSQL_DATABASE: homestead
DB_HOST: mysql
test:
stage: test
services:
- mysql:5.7
image: triopsi/gitlab-ci-pipeline-php:8.2
script:
- yarn install --pure-lockfile
- composer install --prefer-dist --no-ansi --no-interaction --no-progress
- cp .env.example .env
- php artisan key:generate
- php artisan migrate:refresh --seed
- ./vendor/phpunit/phpunit/phpunit -v --coverage-text --colors=never --stderr
.gitlab-ci.yml using mysql service, stages and cachestages:
- test
- deploy
# Variables
variables:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: homestead
MYSQL_PASSWORD: secret
MYSQL_DATABASE: homestead
DB_HOST: mysql
# Speed up builds
cache:
key: $CI_BUILD_REF_NAME # changed to $CI_COMMIT_REF_NAME in Gitlab 9.x
paths:
- vendor
- node_modules
- public
- .yarn
test:
stage: test
services:
- mysql:5.7
image: triopsi/gitlab-ci-pipeline-php:8.2
script:
- yarn config set cache-folder .yarn
- yarn install --pure-lockfile
- composer install --prefer-dist --no-ansi --no-interaction --no-progress
- cp .env.example .env
- php artisan key:generate
- php artisan migrate:refresh --seed
- ./vendor/phpunit/phpunit/phpunit -v --coverage-text --colors=never --stderr
artifacts:
paths:
- ./storage/logs # for debugging
expire_in: 7 days
when: always
deploy:
stage: deploy
image: triopsi/gitlab-ci-pipeline-php:8.2
script:
- echo "Deploy all the things!"
only:
- master
when: on_success
.gitlab-ci.yml using mysql service and cachestages:
- test
# Variables
variables:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: homestead
MYSQL_PASSWORD: secret
MYSQL_DATABASE: homestead
DB_HOST: mysql
# Speed up builds
cache:
key: $CI_BUILD_REF_NAME # changed to $CI_COMMIT_REF_NAME in Gitlab 9.x
paths:
- vendor
- node_modules
- public
- .yarn
test:
stage: test
services:
- mysql:5.7
image: triopsi/gitlab-ci-pipeline-php:8.0-chromium
script:
- yarn config set cache-folder .yarn
- yarn install --pure-lockfile
- composer install --prefer-dist --no-ansi --no-interaction --no-progress
- cp .env.example .env
- php artisan key:generate
- php artisan migrate:refresh --seed
- php artisan serve &
- ./vendor/laravel/dusk/bin/chromedriver-linux --port=9515 &
- sleep 5
- php artisan dusk
artifacts:
paths:
- ./storage/logs # for debugging
- ./tests/Browser/screenshots # for Dusk screenshots
- ./tests/Browser/console
expire_in: 7 days
when: always
Content type
Image
Digest
sha256:b80dd01d8…
Size
374.4 MB
Last updated
almost 2 years ago
docker pull triopsi/gitlab-ci-pipeline-php