Alpine + php8.3 + xdebug + common libs. Image for testing symfony projects in CI environments
162
Lightweight Docker image for GitLab CI jobs in Symfony/PHP projects.
Built for common backend CI tasks:
phpunitBase image:
php:8.3-cli-alpinePreinstalled tools:
PHP extensions:
intlzipgdpdo_sqlitexdebugbackend:phpunit:
stage: backend
image: wormaster/symfony-php-ci:8.3
coverage: '/^\s*Lines:\s*([0-9]+\.[0-9]+)\%/'
before_script:
- eval "$(ssh-agent -s)"
- chmod 400 "$SSH_PRIVATE_KEY"
- ssh-add "$SSH_PRIVATE_KEY"
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- cp "$SSH_KNOWN_HOSTS" ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- cd backend
- composer install --prefer-dist --no-interaction --no-progress
script:
- php -d xdebug.mode=coverage bin/phpunit --coverage-text --colors=never --log-junit var/phpunit.junit.xml
artifacts:
when: always
reports:
junit: backend/var/phpunit.junit.xml
paths:
- backend/var/phpunit.junit.xml
expire_in: 1 week
SSH_PRIVATE_KEYPrivate SSH key used by the pipeline to access private git repositories or private Composer dependencies.
Recommended settings:
FileSSH_PRIVATE_KEYUsed in CI as:
chmod 400 "$SSH_PRIVATE_KEY"
ssh-add "$SSH_PRIVATE_KEY"
SSH_KNOWN_HOSTSknown_hosts file with SSH host fingerprints for the servers used in the pipeline.
Recommended settings:
FileSSH_KNOWN_HOSTSUsed in CI as:
mkdir -p ~/.ssh
chmod 700 ~/.ssh
cp "$SSH_KNOWN_HOSTS" ~/.ssh/known_hosts
chmod 644 ~/.ssh/known_hosts
known_hostsExample:
ssh-keyscan git.example.com > known_hosts
For a custom SSH port:
ssh-keyscan -p 2222 git.example.com > known_hosts
Store the generated file as the SSH_KNOWN_HOSTS GitLab variable with type File.
SSH_PRIVATE_KEY and SSH_KNOWN_HOSTS should be stored as File variables.composer install.xdebug is included for coverage collection.Content type
Image
Digest
sha256:27be5502b…
Size
161.5 MB
Last updated
7 months ago
docker pull wormaster/symfony-php-ci:8.3