Skip to content

pozgo/docker-httpd-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Apache winth PHP-FPM in a Docker with Supervisor (CentOS 7)

Build Status
GitHub Open Issues
Stars Fork
Docker Start Docker Pulls Docker Auto

Felling like supporting me in my projects use donate button. Thank You!

This is Docker Image with Apache + PHP-FPM combo using polinux/supervisor docker image as base.

For different PHP versions, look up different branches of this repository. On Docker Hub you can find them under different tags:

PHP Version Image Name Branch Status
7.2 polinux/httpd-php:php72 php-7.2 Build Status
7.1 polinux/httpd-php:php71 php-7.1 Build Status
7.0 polinux/httpd-php:php70 php-7.0 Build Status
5.6 polinux/httpd-php:php56 php-5.6 Build Status

This image have inotify installed and set to gracefuly reload when Apache config changes, including VHosts.

Default web directory is set to /var/www/html/. info.php is present in this image. just got to http://localhost/info.php

Multiple versions of php can be selected from tags in Docker Hub.

Common dev tools for web app development

  • Ruby 2.0, Bundler
  • NodeJS and NPM
  • NPM packages like gulp, grunt, bower, browser-sync

Packages installed (PHP mods)

  • php-fpm
  • php-gd
  • php-mbstring
  • php-mcrypt
  • php-pdo
  • ImageMagick
  • GraphicsMagick
  • gulp
  • grunt-cli
  • bower
  • browser-sync
  • node
  • ruby
  • bundler
  • memcached
  • redis
  • git

Environmental Variable (From polinux/httpd image)

Variable DefaultSettings Info
LOG_LEVEL info Specify log level Apache should when started. Apache Log Levels
DEFAULT_CONFIG true Use default config provided by Apache package - Change to false when using custom config

Usage

Basic

docker run \
  -d \
  --name httpd-php \
  -p 80:80 \
  polinux/httpd-php

Set log level to debug and php 7.1

docker run \
  -d \
  --name httpd-php \
  -p 80:80 \
  -e LOG_LEVEL="debug" \
  polinux/httpd-php:php71

Build

docker build -t polinux/httpd-php .

Docker troubleshooting

Use docker command to see if all required containers are up and running:

$ docker ps

Check logs of httpd-php server container:

$ docker logs httpd-php

Sometimes you might just want to review how things are deployed inside a running container, you can do this by executing a bash shell through docker's exec command:

docker exec -ti httpd-php /bin/bash

History of an image and size of layers:

docker history --no-trunc=true polinux/httpd-php | tr -s ' ' | tail -n+2 | awk -F " ago " '{print $2}'

Author

Przemyslaw Ozgo (linux@ozgo.info)

About

Apache with PHP in a Docker (Supervisor CentOS)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages