Basic concepts

Layers

Docker is the container-engine in which all services and tools are run, this ensures a maximum of portability across platforms and environments.

TODO: Link to Docker Docs

Services

Services are defined in docker-compose.yml they describe the stack components, such as the PHP application, databases, caches or testing containers.

Images

Runtime

  • dmstr/docker-php-yii2 PHP runtime prepared for Yii 2.0 Framework
  • phundament/nginx-one (for running PHP and nginx as separate containers)

Pre-build application template images

Stacks

Stacks and their service definitions can have different flavours. You may need slightly different setups in development, testing, staging and production environment.

phd supports extending configurations from docker-compose.

Containers

The application along with other services are run in containers, usually you have one container per service, but you can also scale PHP-FPM with a haproxy or run multiple workers off a CLI container.

Source-code

The topmost layer of the stack is the application source-code in /src. The PHP application is build with Yii 2.0 Framework.

TODO: Link to Guide, API

Application framework and composer packages

The building blocks of the application.

Directories & files

Docker & docker-compose

docker-compose.yml  docker container setup
Dockerfile          docker image build information

Application source

.env                environment config
src/                application source-code
yii                 application CLI
runtime/            files generated during runtime

Build support

Makefile            build and Docker stack control-targets
build/              files for Docker build tasks

Testing

codeception.yml     test-suite configuration
tests/              various tests for objects that are common among applications

src/

assets/             application assets such as JavaScript and CSS
config/             application configuration
controllers/        web-controller classes
commands/           console controller classes
models/             application model classes
modules/            application modules (eg. admin)
migrations/         database migrations
views/              view files for the application
web/                document root with entry-script

See also Yii 2.0 Guide

Development stack

graph TD
  php
  test-php
  db
  mailcatcher
  local-browser
  selenium-browser
  
  php-->db
  test-php-->db
  
  local-browser-->php
  local-browser-.->test-php
  local-browser-->mailcatcher
  selenium-browser-->test-php



Help us to improve the documentation, fork this page.