apache2 + php8 + modules + switch public/ or not
10K+
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.
Example:
8.4 currently points to 8.4.20-apache-trixieArchitecture note:
arm64 images now use separate tags with the -arm64 suffix.FORCE_CHOWN, disabled by default.true, /var/www ownership is updated using the provided PUID and PGID.locales-all.index.php generation when no file exists.PUID and PGID variables to define the apache2 user IDs and set ownership on /var/www.redis PHP extension.PHP and its dependencies are installed from the packages.sury.org repository included in the image.
locales-all nano tree git zip unzip smbclient composer mariadb-client postgresql-client redis-tools curl sqlite3
| Module | Module | Module |
|---|---|---|
| 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) |
| Extension | Extension | Extension |
|---|---|---|
| apcu | bcmath | bz2 |
| calendar | Core | ctype |
| curl | date | dba |
| dom | ds | exif |
| fileinfo | filter | ftp |
| gd | gettext | gmp |
| hash | iconv | igbinary |
| imagick | imap | intl |
| json | ldap | libxml |
| mbstring | memcached | mongodb |
| msgpack | mysqli | mysqlnd |
| openssl | pcntl | pcre |
| PDO | pdo_dblib | pdo_mysql |
| pdo_pgsql | pdo_sqlite | pgsql |
| Phar | posix | pspell |
| random | readline | redis |
| Reflection | session | shmop |
| SimpleXML | snmp | soap |
| sockets | sodium | SPL |
| sqlite3 | standard | sysvmsg |
| sysvsem | sysvshm | tidy |
| tokenizer | xml | xmlreader |
| xmlwriter | xsl | Zend OPcache |
| zip | zlib |
All persistent files are stored in /var/www. You should bind this directory to a location on your host.
| Path | Description |
|---|---|
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 |
| Variable | Description |
|---|---|
TZ | Time zone to use inside the container |
PUBLIC_FOLDER | If true, Apache document root is /var/www/html/public/; if false, it is /var/www/html/ |
PROXY_LOCAL_IPS | IP address of your local reverse proxy |
PROXY_EXTERNAL_IPS | External reverse proxy IP address, if needed |
PUID | User ID for the apache2 user |
PGID | Group ID for the apache2 user |
FORCE_CHOWN | If true, /var/www is recursively chowned by the provided PUID and PGID at boot; default: false |
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 -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
Two helper binaries are available inside the container:
apache-stopapache-startThey can be useful in cron jobs, for example if you want to temporarily stop Apache before running mysqldump or pg_dump.
Content type
Image
Digest
sha256:351ae2153…
Size
465.4 MB
Last updated
22 days ago
docker pull waazaafr/webserver-apache-php8:8.5