GithubHelp home page GithubHelp logo

myzero1 / app Goto Github PK

View Code? Open in Web Editor NEW

This project forked from phundament/app

0.0 1.0 0.0 9.74 MB

Dockerized Yii2 web application base

Home Page: http://phundament.com

License: Other

Makefile 3.78% Shell 5.54% PHP 87.78% JavaScript 0.07% CSS 2.24% Batchfile 0.58%

app's Introduction

๐Ÿšจ THIS PROJECT IS DEPRECATED - Next version phd5 is available


phd4

formerly known as Phundament 4

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

Requirements

For alternative installation methods, such as composer, see the docs.

Installation

Download or clone the repository and go to the application directory

git clone https://github.com/phundament/app
cd app

Heads up! Phundament features Makefile targets for development and continuous integration, type make help to see all available targets or make all to run installation and setup.

Create environment configuration files

cp .env-dist .env
cp docker-compose.override-dist.yml docker-compose.override.yml

Start the application stack

docker-compose up -d

Run setup commands

docker-compose run php composer install
docker-compose run php setup.sh

After startup is complete, open http://<DOCKER_HOST>:40080 to access the application and login with admin/admin.

Configuration

Environment overrides - docker-compose.override.yml

  • host-volumes for local development
  • port mappings

Environment defaults - 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.

Application defaults - .env

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

Application

  • APP_NAME unique application and container identifier [a-z0-9]
  • APP_TITLE display name of the application
  • APP_LANGUAGES available languages for URL manager (eg. en,de)
  • 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_MIGRATION_LOOKUP comma separated list of Yii aliases to look for database migrations, eg. @app/migrations/data
  • APP_CONFIG_FILE custom configuration file to load
  • 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)
  • APP_ASSET_FORCE_PUBLISH force asset publishing after any changes to asset files. Note! This may degrade performance, use only during development.

Framework

  • 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.

Database

  • 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

Application configuration - config/main.php

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

Settings

Web UI for application wide key-value store.

  • pages Sitemap
  • availableRoutes
  • schmunk42.markdocs Markdown
  • markdownUrl URL or local path for markdown eg. https://raw.githubusercontent.com/phundament/docs/master
  • defaultIndexFile eg. 1-introduction/about.md
  • cms.assets Assets/LESS
  • useDbAsset boolean

Users & permissions

Default users

  • admin

Default roles

  • Editor
  • Public

๐Ÿ’ก To enable public access you need to assign permissions, like app_site, docs_default, to the Public role.

Testing

First, build your application image

docker-compose build 

Set environment variables for test stack

export COMPOSE_PROJECT_NAME=testapp
export BUILD_PREFIX=app

Start test stack and enter tester CLI container

docker-compose -f docker-compose.yml -f build/compose/test.override.yml up -d    
docker-compose -f docker-compose.yml -f build/compose/test.override.yml run tester bash    

Setup application (container bash)

$ setup.sh

Run test suites (container bash)

$ codecept run functional prod
$ codecept run acceptance prod

โ„น๏ธ YII_ENV must be set to test when running codeception.

Deployment

Required variables for building & pushing docker images.

  • REGISTRY_USER
  • REGISTRY_PASS
  • REGISTRY_HOST
  • IMAGE_NAME

Links


Built by *dmstr, Stuttgart ๐Ÿ‡ฉ๐Ÿ‡ช

app's People

Contributors

cebe avatar cornernote avatar creocoder avatar crtlib avatar disco-tex77 avatar dletz avatar drsdre avatar gonimar avatar igorsantos07 avatar jasrags avatar kartik-v avatar klimov-paul avatar kumorig avatar lancecoder avatar lucianobaraglia avatar marc7000 avatar mohorev avatar motin avatar pat812 avatar philippfrenzel avatar qiangxue avatar ragazzo avatar resurtm avatar samdark avatar schmunk42 avatar slavcodev avatar stphivos avatar suralc avatar trianman avatar uldisn avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.