How to use this template

Create a new project folder

Copy downloaded and extracted folder to a new name:

cp -r docker-php-starterkit my-new-php-app


git clone my-new-php-app 

In the new folder remove the docs of the kit and its git repo

cd my-new-php-app && rm -rf docs .git

The initial file structure looks like this:

├── docker                         # Docker data
│  ├──                       << shellscript for initialization
│  ├──                   << config file
│  └── templates                     << folder with templates
│     ├── docker-compose.yml
│     ├── dot_env
│     ├── extra-php-config.ini
│     ├── my.cnf
│     ├──
│     ├── vhost_app.conf
│     └── web-server-Dockerfile
├── public_html                    # your webroot for your project
│  └── index.php

Edit variables and files

  • edit ./docker/ … and edit
    • APP_NAME=my_new_app
    • optional: set a new port APP_PORT=8001
    • set APP_* variables for packages to install or PHP version
    • set DB_ADD to true or false to say if a database container is needed
    • If a database is needed then set DB_PORT and MYSQL_* variables
  • edit ./docker/templates/vhost_app.conf to describe apache vhost config
  • edit php settings in ./docker/templates/extra-php.ini
  • edit mysql settings in ./docker/templates/my.cnf

First start

  • start init script in the docker folder: ./docker/
    • use g to remove git data of the starterkit
    • use i for init … it sets an ACL on the ./public_html/ subdir to allow write access for your current user and the apache user in the docker container
    • use t to generate config files from templates with the settings from ./docker/
    • use u to bring up the container (OR run docker-compose up -d )

Edit files

  • If the container was started you can …
    • open in your browser http://localhost:8001 to access ./public_html/
    • edit files with the IDE of your choice


You can start ./docker/ with a single letter in the interactive menu too, i.e. ./docker/ u to bring up the docker instance.

If you created the config files from templates you can repeat the creation ./docker/ t. Before applying a change you should shutdown your docker instance.