Sign inSign up

viblo/php

By viblo

•Updated almost 7 years ago

PHP FPM/CLI with support for PostgreSQL, MySQL & some common extensions

Image
0

10K+

viblo/php repository overview

⁠PHP Docker Image

PHP images based on the official image⁠ with support for PostgreSQL, MySQL, some common extensions & configurable via environment variables.

Docker Cloud Build Status

⁠Available tags

These are all available tags divided into six variants⁠.

⁠Installed extensions

The following extra PHP extensions are installed.

  • opcache
  • zip
  • gd (with JPEG support)
  • bcmath
  • mysqli
  • pdo_mysql
  • pgsql
  • pdo_pgsql

You may install more extensions following the same method used with the official PHP image⁠.

⁠Configuration

Configuration via environment variables is supported. Environment variables prefixed with PHP. are set as PHP configurations. Environment variables prefixed with PHP_FPM. are set as configuration for the www pool (fpm and Caddy variants only). For example:

docker run --rm -it \
    -e PHP.memory_limit=256M \
    -e PHP.post_max_size=64M \
    -e PHP.upload_max_file_size=64M \
    viblo/php
docker run --rm -it \
    -e PHP.memory_limit=256M \
    -e PHP_FPM.pm=ondemand \
    -e PHP_FPM.pm.max_children=40 \
    viblo/php:fpm

Or you can use the original method⁠ as used with the official image.

⁠PHP-FPM Healthcheck

Healthcheck for php-fpm image is included as a script php-fpm-healthcheck.

docker run --rm -d  \
    --health-cmd=php-fpm-healthcheck \
    --health-interval=15s \
    --health-timeout=3s \
    --health-retries=3 \
    viblo/php:fpm

Using docker-compose:

healthcheck:
  test: ["CMD", "php-fpm-healthcheck"]
  interval: 15s
  timeout: 3s
  retries: 3

⁠Image variants

There are 3 variants (PHP CLI, PHP-FPM, Caddy) based on Alpine and Debian Stretch to fit your specific use cases. Default base is Alpine for minimal image size. You can use the Debian variant if you need support for glibc dependent packages/extensions.

Docker tags follow the pattern viblo/php:<version>-<variant>-<base>. <variant> is either cli, fpm, or caddy. <base> is either alpine or stretch (current Debian suite). Omiting <version> or <base> will make them the default values (PHP 7.3 on Alpine).

⁠Caddy

The Caddy variant contains the Caddy HTTP server⁠ to serve the application with php-fpm. Refer to the Caddy image⁠ for detailed usage.

Tag summary

Content type

Image

Digest

Size

32.2 MB

Last updated

almost 7 years ago

docker pull viblo/php