Apache with PHP
3.1K
This container is implementing a webserver with php. It uses apache/httpd for the webserver
and the php packages offered by the alpine distribution.
I didn't thought this for production, but rather for my testing needs, and a small footprint (that's why the alpine base). Even so, I have tried to add as much php extensions possible into it, so there is a big chance it will support any of your applications.
I just wanted the easiest way to get up and running with a php application, and this container seems a good answer.
The easiest way to run this container and experience how it works is to choose a tag that also include http configuration and webpages, like in the example below:
docker container run \
--interactive \
--tty \
--detach \
--rm \
--name phpine \
--hostname phpine \
--publish 8080:80 \
routerology/phpine:8.3_html
If you want to use your own http config and serve your own webpages, you should choose instead a tag without _html, and mount the config file and the documentroot, like in the example below:
docker container run \
--name phpine \
--hostname phpine \
--detach \
--rm \
--env TZ="Europe/Bucharest" \
--restart unless-stopped \
--mount type=bind,source=$(pwd)/www,destination=/var/www/localhost/htdocs/ \
--mount type=bind,source=$(pwd)/log,destination=/var/www/logs/ \
--mount type=bind,source=$(pwd)/httpd_conf/httpd.conf,destination=/etc/apache2/httpd.conf \
--interactive \
--tty \
--publish 8080:80 \
routerology/phpine:latest
In order for this to work you need to have the www and log directories in the curent folder and also provide the httpd.conf.
Apart from httpd/php it is installing some other usefull tools
apk add \
net-tools \
tcpdump \
ca-certificates \
iproute2 \
shadow \
wget \
The original alpine container starts httpd as root, and after that it starts the child processes as "apache" user which has uid 100. In this container I am modifying the uid and gid of apache to 1000:1000
usermod -u 1000 apache && \
groupmod -g 1000 apache
There are also some versions of this container that are pushing a default httpd and php config file, and also include a test webpage with a couple of usefull features. I am copying all the webpages inside the default DocumentRoot which is /var/www/localhost/htdocs/.
You will find a couple of tags that correspond with the php version:
7 - latest php7 version available in the alpine distro
8.1 - latest php8.1 version available in the alpine distro
8.2 - latest php8.2 version available in the alpine distro
8.3 - latest php8.3 version available in the alpine distro
7_html - the same as tag 7 but with included test webpages
8.1_html - the same as tag 8.1 but with included test webpages
8.2_html - the same as tag 8.2 but with included test webpages
8.3_html - the same as tag 8.3 but with included test webpages
Content type
Image
Digest
sha256:f623e7c56…
Size
65.7 MB
Last updated
about 1 month ago
docker pull routerology/phpine