waazaafr/webserver-apache-php8

By waazaafr

Updated 22 days ago

apache2 + php8 + modules + switch public/ or not

Image
Networking
Languages & frameworks
Integration & delivery
0

10K+

waazaafr/webserver-apache-php8 repository overview

webserver-apache-php8

Apache + PHP 8 Docker image with a persistent /var/www layout, optional reverse proxy support, and a wide set of common PHP extensions and utilities.


Tag normalization

  • Each PHP minor version tag matches the corresponding upstream base PHP image.
  • Major version tags always point to the latest minor release available in that branch.

Example:

  • 8.4 currently points to 8.4.20-apache-trixie

Architecture note:

  • arm64 images now use separate tags with the -arm64 suffix.

Changes

2026-05-01
  • Added FORCE_CHOWN, disabled by default.
  • When set to true, /var/www ownership is updated using the provided PUID and PGID.
2026-03-20
  • Added locales-all.
2026-03-15
  • Removed automatic index.php generation when no file exists.
2026-02-15
  • Added PUID and PGID variables to define the apache2 user IDs and set ownership on /var/www.
2026-01-27
  • Added the redis PHP extension.
  • Fixed proxy handling.

Description

PHP and its dependencies are installed from the packages.sury.org repository included in the image.

Included utilities
locales-all nano tree git zip unzip smbclient composer mariadb-client postgresql-client redis-tools curl sqlite3
Enabled Apache modules
ModuleModuleModule
core_module (static)so_module (static)watchdog_module (static)
http_module (static)log_config_module (static)logio_module (static)
version_module (static)unixd_module (static)access_compat_module (shared)
alias_module (shared)auth_basic_module (shared)authn_core_module (shared)
authn_file_module (shared)authz_core_module (shared)authz_host_module (shared)
authz_user_module (shared)autoindex_module (shared)deflate_module (shared)
dir_module (shared)env_module (shared)filter_module (shared)
mime_module (shared)mpm_prefork_module (shared)negotiation_module (shared)
php_module (shared)remoteip_module (shared)reqtimeout_module (shared)
rewrite_module (shared)setenvif_module (shared)status_module (shared)
Included PHP extensions
ExtensionExtensionExtension
apcubcmathbz2
calendarCorectype
curldatedba
domdsexif
fileinfofilterftp
gdgettextgmp
hashiconvigbinary
imagickimapintl
jsonldaplibxml
mbstringmemcachedmongodb
msgpackmysqlimysqlnd
opensslpcntlpcre
PDOpdo_dblibpdo_mysql
pdo_pgsqlpdo_sqlitepgsql
Pharposixpspell
randomreadlineredis
Reflectionsessionshmop
SimpleXMLsnmpsoap
socketssodiumSPL
sqlite3standardsysvmsg
sysvsemsysvshmtidy
tokenizerxmlxmlreader
xmlwriterxslZend OPcache
zipzlib

Usage

All persistent files are stored in /var/www. You should bind this directory to a location on your host.

Persistent layout
PathDescription
cron/Contains the crontab file used to add your scheduled tasks
ini/Contains configurable PHP-related configuration files
logs/Apache access and error logs
html/Directory where your website files should be placed
Environment variables
VariableDescription
TZTime zone to use inside the container
PUBLIC_FOLDERIf true, Apache document root is /var/www/html/public/; if false, it is /var/www/html/
PROXY_LOCAL_IPSIP address of your local reverse proxy
PROXY_EXTERNAL_IPSExternal reverse proxy IP address, if needed
PUIDUser ID for the apache2 user
PGIDGroup ID for the apache2 user
FORCE_CHOWNIf true, /var/www is recursively chowned by the provided PUID and PGID at boot; default: false

Launch

Docker Compose
services:
  app:
    image: waazaafr/webserver-apache-php8:8.2
    container_name: webserver
    restart: unless-stopped
    ports:
      - "8787:80"
    volumes:
      - ./webserver:/var/www
    environment:
      TZ: Europe/Paris
      PUBLIC_FOLDER: "false"
      PROXY_LOCAL_IPS: 192.168.1.23
      PROXY_EXTERNAL_IPS: 192.168.1.23
Docker run
docker run -d \
  --name webserver \
  --restart unless-stopped \
  -p 8787:80 \
  -v ./webserver:/var/www \
  -e TZ=Europe/Paris \
  -e PUBLIC_FOLDER=false \
  -e PROXY_LOCAL_IPS=192.168.1.23 \
  -e PROXY_EXTERNAL_IPS=192.168.1.23 \
  waazaafr/webserver-apache-php8:8.2

Tools

Two helper binaries are available inside the container:

  • apache-stop
  • apache-start

They can be useful in cron jobs, for example if you want to temporarily stop Apache before running mysqldump or pg_dump.


Tag summary

Content type

Image

Digest

sha256:351ae2153

Size

465.4 MB

Last updated

22 days ago

docker pull waazaafr/webserver-apache-php8:8.5