Sign inSign up

wethemakers/php-nginx

By wethemakers

•Updated over 2 years ago

Optimized PHP-FPM & Nginx for Magento 2/Laravel. Supports PHP 5.6-8.3. Lightweight Alpine Linux base

Image
Languages & frameworks
Web servers
0

1.1K

wethemakers/php-nginx repository overview

⁠PHP-FPM with Nginx Docker Image

This Docker image provides a robust and flexible setup combining PHP-FPM and Nginx, optimized for various PHP versions. It is based on the Alpine Linux distribution for a lightweight and secure environment. The image is tailored for a variety of PHP versions, ranging from legacy support to the latest PHP releases.

⁠Supported PHP Versions

  • PHP 5.6
  • PHP 7.0
  • PHP 7.1
  • PHP 7.2
  • PHP 7.4
  • PHP 8.0
  • PHP 8.1
  • PHP 8.2
  • PHP 8.3

⁠Features

  • PHP-FPM: The image uses PHP-FPM (FastCGI Process Manager) to manage PHP processes efficiently.
  • Nginx: Nginx is included for serving HTTP requests, configured for optimal performance with PHP-FPM.
  • Composer: Integrated Composer for dependency management, pre-configured with hirak/prestissimo for faster installs.
  • PECL Extensions: Additional PECL extensions are pre-installed for extended functionality.
  • Supervisor: Supervisor is used to manage processes, ensuring both PHP-FPM and Nginx are running correctly.
  • Configuration: Custom configuration files for PHP and PHP-FPM are included, allowing easy adjustments to fit your needs.
  • Logging: Logs for Nginx are redirected to standard output for easier management and integration with logging systems.

⁠Installed Packages

The image includes essential packages and libraries required for a wide range of PHP applications:

  • Development Tools: git, zip, unzip, dos2unix, g++
  • PHP Extensions: gd, pcntl, bcmath, mysqli, pdo_mysql, intl, soap, xsl, zip, sockets
  • Libraries: libpng, libzip, freetype, libjpeg-turbo, curl, icu, libxml2, libxslt, zlib
  • PECL Extensions: zip, igbinary

⁠Magento 2 and Laravel Ready

This image is specifically built to support applications built with Magento 2 and Laravel, providing all necessary dependencies and configurations out of the box.

⁠Usage

To use this image, you can pull it from the Docker repository for the specific PHP version you require. For example, to use PHP_VERSION:

docker pull wethemakers/php-nginx:PHP_VERSION

You can then run a container using:

docker run -d -p 80:80 wethemakers/php-nginx:PHP_VERSION

Ensure to mount your application code and any required configuration files appropriately.

⁠Configuration

The image comes with default configuration files:

  • Supervisord Configuration: /etc/supervisord.conf
  • PHP Configuration: /usr/local/etc/php/php.ini
  • PHP-FPM Configuration: /usr/local/etc/php-fpm.d/www.conf

You can replace these with your custom configurations by mounting them as volumes:

docker run -d -p 80:80 \
    -v /path/to/your/php.ini:/usr/local/etc/php/php.ini \
    -v /path/to/your/www.conf:/usr/local/etc/php-fpm.d/www.conf \
    wethemakers/php-nginx:PHP_VERSION

⁠Conclusion

This Docker image is designed to provide a reliable and flexible PHP-FPM and Nginx environment, suitable for a wide range of applications and compatible with multiple PHP versions. Whether you're maintaining legacy applications or developing new ones, this image offers the tools and configurations needed for a streamlined development and deployment process. Its support for Magento 2 and Laravel ensures that you have everything you need to run these popular frameworks efficiently.

Tag summary

Content type

Image

Digest

sha256:fe8063290…

Size

171.7 MB

Last updated

over 2 years ago

docker pull wethemakers/php-nginx:8.3.7-fpm-alpine3.20