leolana / phpdocker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

leonardolana/phpdocker

Usage

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

Example

Tags

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

Available Bash scripts

This performs a HTTP Request and checks returned status code.

Returns non-zero exit code when status is not 200 (OK).

Usage: URL="https://www.example.com" check-status-code

Returns non-zero exit code when status is not 403 (Forbidden).

Usage: URL="https://www.example.com" STATUS=403 check-status-code

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 5.6, use leonardolana/phpdocker:5.6.

MariaDB

  • MariaDB is not started automatically.
  • Type service mysql start if you want start it.
  • Then you can work with DB, eg. mysql -e 'create database test;'.
  • Default mysql user is root without password.

Redis

  • Redis is not started automatically.
  • Type service redis-server start if you want start it.
  • Then you can work with DB, eg. redis-cli ping.

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 --log-junit shippable/testresults/junit.xml --coverage-xml shippable/codecoverage -c tests/configuration.xml tests.

About

License:MIT License


Languages

Language:Shell 100.0%