Containers set for comprehensive php application runtime environment.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Docker PHP environment



Containers set for comprehensive php application runtime environment. It consists of:

  • nginx
  • php5.6
  • php7.0
  • mysql
  • source code (sample application)

There are 5 seperate containers able to speak to each other. Setting up whole environment is as simple as run just one command. Each container is based on Ubuntu 14.04

This configuration derives from Nospor's blog. Thank you very much :)

After run new directory named www will appear (in current location). It consists the application source. Every modification to this code affects running application so it allows developers to work with the code. If www directory is not empty exisitng files will NOT be overwritten due to remain local changes untouched.


  • Add to /etc/hosts
# OSX ayeo.php56 ayeo.php70

# Linux ayeo.php56 ayeo.php70
  • Get config and run
git clone docker
cd docker
docker-compose up -d
  • Check if everyting works properly

    • PHP 7.0 http://ayeo.php70:8080
    • PHP 5.6 http://ayeo.php56:8080

Docker bash aliases

Helpfull docker aliases. Add to ~/.bash_profile

dstop() { docker stop $(docker ps -a -q); }
drm() { docker rm $(docker ps -a -q); }
drmi() { docker rmi $(docker images -q); }
dexec() { docker exec -i -t $1 bash; }
dip() { docker inspect $(docker ps -q) | grep IPA; }
dup() { docker-compose up -d; }
dps() { docker ps; }


  • Configure php.ini (display_errors, error_raporting)
  • Make all logs accessible outside container
  • Use supervisord to keep container alive