Personal apache setup using PHP-FPM, requires another PHP-FPM docker image.
497
Based on https://hub.docker.com/_/httpd/ The "latest"-image is based on httpd:2.4-alpine
Personal apache setup using PHP-FPM, requires a PHP-FPM docker image: official ones from PHP or the custom build one in our other repository. Note: If you don't need PHP (like only serving plain html) then we recommend using the vanilla HTTPD container or something lightweight like nginx/lighttpd.
Add your own configurations by adding entries to the web-container volumes under "/usr/local/apache2/conf/other/":
web:
volumes:
- myconfiguration.conf:/usr/local/apache2/conf/other/myconfiguration.conf
Note that HTTPS is disabled so don't forget to enable that when you need it.
version: '3'
services:
web:
image: jurriaanr/apache:2.4-fpm
restart: always
network_mode: "bridge"
environment:
- "VIRTUAL_HOST=my.domain.ext"
- "APACHE_DOCUMENTROOT=/app/web"
links:
- php
depends_on:
- php
volumes:
- .:/app/:delegated
php:
image: jurriaanr/php:8.3-fpm
restart: always
network_mode: "bridge"
volumes:
- .:/app/:delegated
Switch PHP version by using another PHP image (exposed PHP-FPM on port 9000).
You can use the PHP_FPM_HOSTNAME and PHP_FPM_PORT environment variables to change the hostname and port Apache uses to connect to PHP-FPM:
version: '3'
services:
web:
...SNIP
environment:
- "VIRTUAL_HOST=my.domain.ext"
- "APACHE_DOCUMENTROOT=/app/web"
- "PHP_FPM_HOSTNAME=my_php_container"
- "PHP_FPM_PORT=9001"
Content type
Image
Digest
sha256:faa234638…
Size
19.8 MB
Last updated
26 days ago
docker pull jurriaanr/apache