Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Dockerized PHP Web Application Template
PHP CSS Makefile Other
Latest commit 4b33e1c @schmunk42 schmunk42 updated packages

Phundament 4

Phundament is a dockerized 12factor PHP application template for Yii Framework 2.0.



Clone the repository and go to the application directory

git clone
cd app


Create environment configuration file

make env-init

Start the application stack

make docker-up app-build app-install app-setup app-open

The new application will open automatically in your default browser

Without MAKE

Create environment configuration file

cp .env-dist .env

Start the application stack

docker-compose up -d

Find the port for the application nginx service

docker-compose port appnginx 80

And open the application in your browser, eg. http://dockerhost:34567

Additional information

List all services

docker-compose ps

Show and follow logs

docker-compose logs

For alternative installation methods see the docs.


Test-drive with docker compose

curl -o docker-compose.yml    
docker-compose up -d

Online Demo

A demo can be found at the Phundament Playground Application Demo! You can get the source-code of the demo application from its GitHub repository.

PaaS / cloud service

Deploy to Tutum


Environment defaults - .env

During development, it is recommended to change application configuration in the .env file, since it does not require restarting the containers.


  • APP_NS namespace for the application, used i.e. for Docker image tags [a-z0-9]
  • APP_NAME unique application and container identifier [a-z0-9]
  • APP_TITLE display name of the application


  • APP_MIGRATION_LOOKUP comma separated list of Yii aliases to look for database migrations, eg. @app/migrations/data
  • APP_ADMIN_EMAIL e-mail address of application admin user (default in ./yii app/create-admin-user)
  • APP_ADMIN_PASSWORD password of application admin user (default in ./yii app/create-admin-user)
  • APP_SUPPORT_EMAIL e-mail address for the application, eg. support@myapp.local
  • APP_COOKIE_VALIDATION_KEY unique and random string to prevent XSS
  • APP_PRETTY_URLS enable or disable nice URLs, allowed values 1 (yes) or 0 (no)

Application development settings

  • APP_ASSET_FORCE_PUBLISH force asset publishing after any changes to asset files. Note! This may degrade performance, use only during development.


  • YII_DEBUG wheter to enable more verbose application output, eg. on PHP exceptions.
  • YII_ENV Yii application mode, allowed values dev, prod or test
  • YII_TRACE_LEVEL amount of caller levels to display for logging.


  • DB_ENV_MYSQL_ROOT_USER user to create databases
  • DB_ENV_MYSQL_ROOT_PASSWORD root password, eg. set from "${DB_ENV_MARIADB_PASS}"
  • DB_ENV_MYSQL_DATABASE database name
  • DB_ENV_MYSQL_PASSWORD database password
  • DB_ENV_MYSQL_USER database user
  • DB_PORT_3306_TCP_ADDR database hostname
  • DB_PORT_3306_TCP_PORT database port
  • DATABASE_TABLE_PREFIX table prefix for default database connection

Environment overrides - docker-compose.yml

You can override any ENV variable in .env within a docker-compose.yml file.

  • VIRTUAL_HOST ~^myapp\. Virtual-host configuration for reverse proxy, adjust the virtual host parameter for web application, we'll use it later to easily access the web-server through a wildcard DNS.

PHP Application settings - config/main.php

For details of available application configuration, please refer to the Yii 2.0 Framework Definitive Guide.

Developed by diemeisterei GmbH, Stuttgart.

Something went wrong with that request. Please try again.