Sign inSign up

belkajo/php84

By belkajo

Updated over 1 year ago

PHP 8.4 with Nginx, Supervisor, Composer, and common extensions on Debian Bookworm

Image
Languages & frameworks
Developer tools
Web servers
0

1.1K

belkajo/php84 repository overview

PHP 8.4 Docker Image (Debian Bookworm)

This Docker image provides a full-featured PHP 8.4 environment on top of Debian Bookworm. It includes PHP-FPM, Nginx, and Supervisor for process management, along with a wide selection of PHP extensions and development utilities.

Features

  • Based on debian:bookworm
  • PHP 8.4 with commonly used extensions:
    • bcmath, curl, dom, fileinfo, ftp, gd, intl, mbstring, mysql, soap, sockets, tokenizer, xml, xsl, zip
    • Plus apcu, opcache, and PECL-based mongodb
  • PHP-FPM and Nginx managed via Supervisor
  • Composer pre-installed
  • Development tools: Git, MariaDB client, unzip, zip, curl, etc.
  • msmtp for sending mail
  • UID/GID customization via HOST_UID and HOST_GID build args
  • Logs stored in /var/log and /tmp

Building the Image

You can build the image with custom UID and GID to match your host user:

docker build \
  --build-arg HOST_UID=$(id -u) \
  --build-arg HOST_GID=$(id -g) \
  -t php8.4-dev .

Running the Container

You can start a container and map your current directory to /var/www/html:

docker run -it --rm \
  -p 8080:80 \
  -v $(pwd):/var/www/html \
  php8.4-dev

By default, this runs:

  • PHP-FPM 8.4 (/usr/sbin/php-fpm8.4 -F)
  • Nginx (/usr/sbin/nginx -g "daemon off;")

Both are managed by supervisord.

Supervisor Configuration

Supervisor is configured via /etc/supervisor/supervisord.conf, and manages:

[program:php-fpm]
command=/usr/sbin/php-fpm8.4 -F

[program:nginx]
command=/usr/sbin/nginx -g "daemon off;"

Logs are written to:

  • PHP-FPM: /var/log/php-fpm.out.log and /var/log/php-fpm.err.log
  • Nginx: /var/log/nginx.out.log and /var/log/nginx.err.log

Supervisor itself logs to /tmp/supervisord.log.

Notes

  • Apache is explicitly disabled (apache2ctl is overwritten to exit 0)
  • The image uses www user and group with customizable UID/GID (default: 1000)
  • Composer is installed globally to /usr/local/bin/composer
  • The working directory is set to /var/www/html

File Structure

  • Dockerfile: defines installation steps
  • etc/supervisor/supervisord.conf: Supervisor launch config

Tag summary

Content type

Image

Digest

sha256:d9a75a944

Size

341.2 MB

Last updated

over 1 year ago

docker pull belkajo/php84