Code Monkey home page Code Monkey logo

alpine-php-fpm's Introduction

Alpine PHP-FPM

Lightweight & optimized Multi-Arch Docker Images (x86_64/arm/arm64) for PHP-FPM (PHP 8.1, 8.2, 8.3) with essential extensions on top of latest Alpine Linux. ๐Ÿ˜

Stable versions

v8.1 v8.2 v8.3
Docker Image 8.1 (tag 8.1 semver)
Docker Image Size (tag)
Docker Image 8.2 (tag 8.2 semver)
Docker Image Size (tag)
Docker Image Version (tag latest semver)
Docker Image Size (tag)

PHP versions support

We only support stable PHP versions according to the PHP Release Cycle. However, you can still find legacy versions like 7.4.x or 8.0.x on Releases and Docker Hub.

Built-in extensions

curl, ftp, hash (mhash), libedit, libsodium, mbstring, mysqlnd, openssl, password-argon2, pdo-sqlite, pear, sqlite3, zlib

Additional extensions

Extension v8.1 v8.2 v8.3
amqp โœ“ โœ“ โœ“
apcu โœ“ โœ“ โœ“
bcmath โœ“ โœ“ โœ“
bz2 โœ“ โœ“ โœ“
exif โœ“ โœ“ โœ“
gd โœ“ โœ“ โœ“
gettext โœ“ โœ“ โœ“
gmp โœ“ โœ“ โœ“
imagick โœ“ โœ“ ?
igbinary โœ“ โœ“ โœ“
imap โœ“ โœ“ โœ“
intl โœ“ โœ“ โœ“
lz4 โœ“ โœ“ โœ“
memcache โœ“ โœ“ โœ“
mongodb โœ“ โœ“ โœ“
msgpack โœ“ โœ“ โœ“
mysqli โœ“ โœ“ โœ“
oauth โœ“ โœ“ โœ“
opcache โœ“ โœ“ โœ“
pcntl โœ“ โœ“ โœ“
pdo_dblib โœ“ โœ“ โœ“
pdo_mysql โœ“ โœ“ โœ“
pdo_pgsql โœ“ โœ“ โœ“
pdo_sqlsrv โœ“ (64-bit only) โœ“ (64-bit only) โœ“ (64-bit only)
pgsql โœ“ โœ“ โœ“
phalcon โœ“ โœ“ ?
psr โœ“ โœ“ โœ“
redis โœ“ โœ“ โœ“
rdkafka โœ“ โœ“ โœ“
soap โœ“ โœ“ โœ“
sockets โœ“ โœ“ โœ“
sqlsrv โœ“ (64-bit only) โœ“ (64-bit only) โœ“ (64-bit only)
ssh2 โœ“ โœ“ โœ“
swoole โœ“ (64-bit only) โœ“ (64-bit only) โœ“ (64-bit only)
sysvmsg โœ“ โœ“ โœ“
sysvsem โœ“ โœ“ โœ“
sysvshm โœ“ โœ“ โœ“
tidy โœ“ โœ“ โœ“
uuid โœ“ โœ“ โœ“
vips โœ“ โœ“ โœ“
xdebug โœ“ โœ“ โœ“
xsl โœ“ โœ“ โœ“
yaml โœ“ โœ“ โœ“
zip โœ“ โœ“ โœ“
zstd โœ“ โœ“ โœ“
ย  ย  ย  ย 
Others
composer v2.7 v2.7 v2.7

Footnotes

  • (?) It means that this extension is obsolete/unmaintained/discouraged or simply is not supported yet.
  • The mcrypt extension is obsolete. Use libsodium or openssl instead.

List all extensions included

If you want to know the whole list of the included extensions then type php -m as follows.

docker run --rm joseluisq/php-fpm:8.3 php -m

Or use php -i to get more detailed information.

Usage

docker pull joseluisq/php-fpm:8.3
# Or
docker pull joseluisq/php-fpm:8.2
# Or
docker pull joseluisq/php-fpm:8.1

๐Ÿณ Available on Docker Hub โ†’ hub.docker.com/r/joseluisq/php-fpm

Dockerfile

FROM joseluisq/php-fpm:8.3
# Or
FROM joseluisq/php-fpm:8.2
# Or
FROM joseluisq/php-fpm:8.1

Run a container

To give a Docker image a quick try, just execute any of those commands and then navigate to localhost:8088

docker run --rm -p 8088:80 joseluisq/php-fpm:8.3 sh -c "echo '<?php phpinfo();' > index.php; php -S [::]:80 -t ."
# Or
docker run --rm -p 8088:80 joseluisq/php-fpm:8.2 sh -c "echo '<?php phpinfo();' > index.php; php -S [::]:80 -t ."
# Or
docker run --rm -p 8088:80 joseluisq/php-fpm:8.1 sh -c "echo '<?php phpinfo();' > index.php; php -S [::]:80 -t ."

View Docker Compose Examples

Default paths

  • Default Docker working directory: /var/www/html
  • Additional PHP .ini files to load: /usr/local/etc/php/conf.d
  • Custom PHP .ini file generated (only if ENV_SUBSTITUTION_ENABLE=true): /usr/local/etc/php/conf.d/default-php.ini

Configurable environment variables

PHP-FPM and PHP configurations can be overwritten using environment variables. To do so, just indicate the substitution of values using ENV_SUBSTITUTION_ENABLE=true (since it is disabled by default).

Below are the environment variables with their default values:

PHP-FPM

Global FPM

Settings replaced into /usr/local/etc/php-fpm.conf file.

  • PHP_FPM_ERROR_LOG=/proc/self/fd/2
  • PHP_FPM_LOG_LEVEL=error

FPM WWW Pool

Settings replaced into /usr/local/etc/php-fpm.d/www.conf file.

  • PHP_FPM_LISTEN=9000
  • PHP_FPM_USER=www-data
  • PHP_FPM_GROUP=www-data
  • PHP_FPM_LISTEN_OWNER=www-data
  • PHP_FPM_LISTEN_GROUP=www-data

PHP Config

Settings replaced into /usr/local/etc/php/conf.d/default-php.ini file (php.ini).

  • PHP_MEMORY_LIMIT=512M
  • PHP_EXPOSE_PHP=On
  • PHP_SESSION_GC_MAXLIFETIME=1440

Docker Compose examples

docker-compose examples for Nginx and Apache servers can be found under the ./examples directory.

Nginx example

docker-compose -f examples/nginx/docker-compose.yml up

Apache example

docker-compose -f examples/apache/docker-compose.yml up

Contributions

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in current work by you, as defined in the Apache-2.0 license, shall be dual licensed as described below, without any additional terms or conditions.

Feel free to send some pull request or file an issue.

License

This work is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).

ยฉ 2020-present Jose Quintana

alpine-php-fpm's People

Contributors

joseluisq avatar ssheduardo avatar tiagodevweb 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.