Phundament is a dockerized 12factor PHP application template for Yii Framework 2.0.
Clone the repository and go to the application directory
git clone https://github.com/phundament/app
Create environment configuration file
cd app
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
List all services
docker-compose ps
Show and follow logs
docker-compose logs
For alternative installation methods see the docs.
curl -o docker-compose.yml https://raw.githubusercontent.com/phundament/app/master/tutum.yml
docker-compose up -d
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.
During development, it is recommended to change application configuration in the
.envfile, since it does not require restarting the containers.
Identifier
APP_NSnamespace for the application, used i.e. for Docker image tags [a-z0-9]APP_NAMEunique application and container identifier [a-z0-9]APP_TITLEdisplay name of the application
Application
APP_MIGRATION_LOOKUPcomma separated list of Yii aliases to look for database migrations, eg.@app/migrations/dataAPP_ADMIN_EMAILe-mail address of application admin user (default in./yii app/create-admin-user)APP_ADMIN_PASSWORDpassword of application admin user (default in./yii app/create-admin-user)APP_SUPPORT_EMAILe-mail address for the application, eg.support@myapp.localAPP_COOKIE_VALIDATION_KEYunique and random string to prevent XSSAPP_PRETTY_URLSenable or disable nice URLs, allowed values1(yes) or0(no)
Application development settings
APP_ASSET_FORCE_PUBLISHforce asset publishing after any changes to asset files. Note! This may degrade performance, use only during development.
Framework
YII_DEBUGwheter to enable more verbose application output, eg. on PHP exceptions.YII_ENVYii application mode, allowed valuesdev,prodortestYII_TRACE_LEVELamount of caller levels to display for logging.
Database
DB_ENV_MYSQL_ROOT_USERuser to create databasesDB_ENV_MYSQL_ROOT_PASSWORDroot password, eg. set from"${DB_ENV_MARIADB_PASS}"DB_ENV_MYSQL_DATABASEdatabase nameDB_ENV_MYSQL_PASSWORDdatabase passwordDB_ENV_MYSQL_USERdatabase userDB_PORT_3306_TCP_ADDRdatabase hostnameDB_PORT_3306_TCP_PORTdatabase portDATABASE_TABLE_PREFIXtable prefix for default database connection
You can override any ENV variable in
.envwithin adocker-compose.ymlfile.
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.
For details of available application configuration, please refer to the Yii 2.0 Framework Definitive Guide.
Developed by diemeisterei GmbH, Stuttgart.