GithubHelp home page GithubHelp logo

koenhendriks / phpdocker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from phpdocker/phpdocker

0.0 3.0 0.0 63 KB

PHP, xDebug, Composer, Node, Yarn, PHP CodeSniffer.

Home Page: https://koenhendriks.com

License: MIT License

Dockerfile 100.00%

phpdocker's Introduction

koenhendriks/phpdocker

Usage

  • Docker image is available at Docker Hub.
  • The primary goal of this Docker image is custom image for CI, but you can use it like you want.

Example

Gitlab CI Example

Multiversion PHP Unit Test

phpunit_72:
  image: koenhendriks/phpdocker:7.2
  stage: test
  script:
    - php ./vendor/bin/phpunit --colors=never -c phpunit-runner.xml

phpunit_73:
  image: koenhendriks/phpdocker:7.3
  stage: test
  script:
    - php ./vendor/bin/phpunit --colors=never -c phpunit-runner.xml

# With xdebug coverage
phpunit74:
  image: koenhendriks/phpdocker:7.4
  stage: test
  script:
    - php -d$XDEBUG_EXT ./vendor/bin/phpunit  --coverage-text --colors=never --coverage-clover ./coverage/phpunit.coverage.xml --log-junit ./coverage/phpunit.report.xml
  artifacts:
    expire_in: 1 week
    reports:
      junit: ./coverage/phpunit.report.xml
    paths:
      - ./coverage/
  only:
    - master
    - tags

Tags

  • Tags depend on version of PHP included.
  • They are given by git branches.
  • You can see them at Docker Hub.

Available Bash scripts

Built-in applications

PHP

  • PHP is started automatically.
  • You can type PHP commands, eg. php -r "echo 1;".
  • Each Docker image contains ONLY ONE VERSION OF PHP, so:
    • If you need PHP 7.0, use koenhendriks/phpdocker:7.0.
    • If you need PHP 7.1, use koenhendriks/phpdocker:7.1.
    • If you need PHP 7.2, use koenhendriks/phpdocker:7.2.
    • If you need PHP 7.3, use koenhendriks/phpdocker:7.3.

Composer

  • Composer is installed globally.
  • You can run it, eg. composer self-update.

PHP_CodeSniffer

  • PHP_CodeSniffer is installed globally.
  • You can run it, eg. phpcs --standard=PSR2 -nsp src tests.

PHPUnit

  • PHPUnit is installed globally.
  • You can run it, eg. phpunit --coverage-text --colors=never --coverage-clover ./phpunit.coverage.xml --log-junit ./phpunit.report.xml.

phpdocker's People

Contributors

hranicka avatar koenhendriks avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.