Skip to content

An ultra-lightweight Docker solution, designed for PHP-FPM performance and adaptability. Join us to build, customize, and push the boundaries of efficient PHP process management with FPM!

License

Notifications You must be signed in to change notification settings

mztrix/docker-php-fpm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mztrix/docker-php-fpm

Docker Hub Docker Pulls Image Size

PHP License: MIT

provides an optimized Docker image for PHP-FPM, based on Alpine Linux. It is designed to offer a lightweight and flexible solution for developers and system administrators deploying PHP applications in containers.

Table of Contents

  • Prerequisites
  • Overview
  • Quick Start
  • Usage with Docker Compose
  • License

Prerequisites

The required tools depend on your use case:

  • To build and run Docker images:

    • Docker: Required for building and running containers.
  • To use multi-container setups:

    • Docker Compose: Required for managing multiple containers via compose.yaml.

Overview

  • Alpine-based image (Dockerfile) with PHP 8.4 FPM and essentials.
  • FPM socket at /var/run/php/www.sock, suitable for sharing with a reverse proxy.
  • Simple entrypoint and default command: php-fpm -F.
  • Healthcheck using cgi-fcgi that hits /ping and expects "pong".

Quick Start

  1. Clone and (optionally) prepare a local override
git clone https://github.com/mztrix/docker-php-fpm
cd docker-php-fpm
cp compose.override.yaml.dist compose.override.yaml   # recommended for local use
  1. Start PHP-FPM
docker compose up -d --wait

This builds the local image (target: base) and starts the php service.

  1. Check status
docker compose ps
docker compose logs -f php

Usage with Docker Compose

  • compose.yaml defines the minimal php service.
  • compose.override.yaml(.dist) shows useful local mounts:
    • .docker/php.ini -> /etc/php84/php.ini
    • .docker/php-fpm.d/www.conf -> /etc/php84/php-fpm.d/www.conf
    • fpm-sock volume -> /var/run/php

Environment/build variable:

  • IMAGES_PREFIX (optional): image name prefix used by compose (defaults to mztrix/php-fpm).

License

MIT — see LICENSE.

About

An ultra-lightweight Docker solution, designed for PHP-FPM performance and adaptability. Join us to build, customize, and push the boundaries of efficient PHP process management with FPM!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published