basantmandal/hk2-php8.1-fpm

By basantmandal

Updated 13 days ago

Based on PHP 8.1 FPM & includes all essential extensions required for Magento2.4.4 till Magento2.4.6

Image
Languages & frameworks
0

1.3K

basantmandal/hk2-php8.1-fpm repository overview

HK2 Magento PHP 8.1 FPM

PHP 8.1 FPM Docker environment specifically optimized for Magento 2.4.4 till Magento 2.4.6

Version Magento Version PHP Version Docker License
Github Repository Website LinkedIn Email

📄 Overview

The HK2 Magento PHP 8.1 FPM project provides a highly optimized, fully configured PHP 8.1 FPM Docker image specifically designed to run Magento 2.4.4 till Magento 2.4.6 environments. It includes all necessary PHP extensions, Composer 1.x, IonCube loaders (with automatic architecture detection for Mac compatibility), and built-in MSMTP support for email routing.

👥 Who is this for?
  • Magento 2 Backend and Frontend Developers
  • DevOps Engineers managing Magento environments
  • E-commerce technical agencies running legacy Magento 2 versions on modern hardware (including Apple Silicon)

✨ Key Features

FeatureDetails
💻 Multi-Architecture SupportFully compatible with standard servers (linux/amd64) and Apple Silicon Macs/ARM devices (linux/arm64) with automated IonCube loader switching. Images are built natively via Docker Buildx.
📦 Pre-configured ExtensionsIncludes essential Magento 2 PHP extensions: bcmath, gd, intl, pdo_mysql, soap, xsl, zip, redis, and optional xdebug.
🧱 Developer ToolsComes pre-installed with Composer 1.10.x, image optimization tools (jpegoptim, optipng), Git, and msmtp for email interception.
🔐 Optimized ConfigurationsPre-tuned php.ini with 2GB memory limit, increased execution times, and optimal upload sizes for heavy Magento operations.

📋 System Requirements

RequirementMinimum Version
Docker Engine20.10.0+
Docker Compose2.0.0+
Hardware4GB RAM minimum (8GB recommended for Magento 2)

Note: This container requires an external web server (Nginx/Apache) to proxy requests to the FPM daemon on port 9000.


🚀 Installation & Usage

The simplest way to use this environment is to pull the pre-built, multi-architecture image directly from Docker Hub:

docker pull basantmandal/hk2-php8.1-fpm:latest

(You can also pin to a specific version like :3.0)

2. Using Docker Compose

Add the following service to your docker-compose.yml:

services:
  php:
    image: basantmandal/hk2-php8.1-fpm:3.0
    build:
      context: .
      args:
        - INSTALL_XDEBUG=false  # Set to true to install Xdebug
    volumes:
      - ./src:/var/www/html
    ports:
      - "9000:9000"
3. Local Development & Testing

If you need to build the image locally or modify configurations:

Clone the repository:

git clone https://github.com/basantmandal/docker-magento2-php81.git
cd docker-magento2-php81

Build the image locally (no cache):

./local_build.sh

Run Automated Validation Tests: Ensure PHP version, required extensions, Composer, and IonCube loaded correctly within the container:

./scripts/03.test.sh

Push to Docker Hub (Maintainers):

./scripts/local_upload_image.sh

Security Warning: Do not expose the FPM port (9000) publicly to the internet. Keep it internal to the Docker network.


⚙️ Configuration

ServiceVersionPurpose
PHP FPM8.1.xCore application processing for Magento.
Composer2.xDependency management optimized for older Magento versions.
IonCubeLatestRequired for running encrypted third-party extensions.

🔒 Content Security Policy (CSP)

This image relies on your web server (Nginx/Apache) or Magento application to configure and enforce Content Security Policies. Ensure your web server passes appropriate CSP headers.


🔐 Privacy & GDPR

This container image does not independently collect, store, or transmit any personally identifiable information (PII). All log outputs are written to standard output (stdout/stderr) and managed locally by your Docker daemon.


📚 Documentation

DocumentPurpose
SECURITY.mdSecurity vulnerability reporting policy and guidelines.
CONTRIBUTING.mdInstructions and rules for contributing to the repository.
DockerfileSource configurations for the Docker container build.

⚠️ Known Limitations

  • Running PHP 8.1 means this environment is meant for legacy operations and should not be used for new Magento 2.4.4+ projects, which require PHP 8.1+.
  • Xdebug is turned off by default (INSTALL_XDEBUG=false) to prevent performance penalties in production-like environments.

🤝 Contributing

We actively welcome contributions! Please read our Contributing Guidelines to understand how to submit bug reports, feature requests, and pull requests.


📄 License

This project is licensed under the OSL 3.0 License. See the LICENSE file for details.


⚖️ Disclaimer

The author provides this Docker image "as is" without any warranties. Users are responsible for ensuring that running this environment complies with their internal security and software requirements.


Basant Mandal
Full Stack Developer

Website LinkedIn



Copyright © 2026 Basant Mandal. All rights reserved.

Tag summary

Content type

Image

Digest

sha256:b7a44cbb8

Size

264.2 MB

Last updated

13 days ago

docker pull basantmandal/hk2-php8.1-fpm