The are collection of Docker images to run PHP Server.
centos5,5-apache-alpine,7,7-apache-alpine,latest
ctype curl date dom fileinfo filter ftp gd gettext hash iconv intl json libxml mbstring mcrypt mysqlnd openssl pcre PDO pdo_dblib pdo_mysql pdo_pgsql pdo_sqlite pgsql Phar posix readline Reflection session SimpleXML SPL sqlite3 standard tokenizer xml xmlreader xmlwriter Zend OPcache zlib
$ docker build -t my-image .There are a few environment variables that can be passed to the container that will enable settings.
DEVMODE=1- Changes a few PHP ini directives.error_reporting = E_ALLdisplay_errors = Ondisplay_startup_errors = OnXDEBUG=1- Enables XDebug module.XDEBUG_REMOTE_HOST=<HOST_IP_ADDRESS>- Sets the remote host address for XDebug.DOCROOT=<CONTAINER_ABSOLUTE_PATH>- Change theDocumentRootdirective in Apache'shttpd.conf.
docker run -d -p 80:80 --name my-app --restart=always \
-v .:/var/www/localhost/htdocs \
-e DEVMODE=1 -e DOCROOT=/var/www/localhost/htdocs/Public \
-e XDEBUG=1 -e XDEBUG_REMOTE_HOST=127.0.0.1 \
anothy/php-server:latestversion: '3'
services:
php7:
image: anothy/php-server:7
restart: always
volumes:
- .:/var/www/localhost/htdocs
ports:
- 8000:80
# Optional ENV
environment:
DOCROOT: /var/www/localhost/htdocs/Public/
DEVMODE: 1
XDEBUG: 1
XDEBUG_REMOTE_HOST: <HOST_IP_ADDRESS>FROM anothy/php-server:7
COPY . /var/www/localhost/htdocs
WORKDIR /var/www/localhost/htdocs$ docker run -d -p 80:80 --name my-app my-app