devilbox/docs/Quickstart.md
2017-06-20 12:16:27 +02:00

2.9 KiB

Devilbox Documentation

Overview | Quickstart | Install | Update | Configure | Run | Usage | Backups | Examples | Technical | Hacking | FAQ


Quickstart

  1. Installation
  2. Update
  3. Tagged release
  4. Master branch
  5. Configuration
  6. .env
  7. Services
  8. Run
  9. Run all
  10. Run selection
  11. Project setup

1. Installation

$ git clone https://github.com/cytopia/devilbox
$ cd devilbox/
$ cp env-example .env

2. Update

2.1 Tagged release

$ docker-compose stop
$ git fetch --all
$ git checkout "$(git describe --abbrev=0 --tags)"

2.2 Master branch

$ docker-compose stop
$ git fetch --all
$ git pull origin master
$ ./update-docker.sh

3. Configuration

3.1 .env

Edit all general settings inside the .env file (file paths, what version to run, debug, timezeon, etc)

$ vim .env

3.2 Services

Configure PHP 5.6

$ cd cfg/
$ echo "max_execution_time = 180" > php-fpm-5.6/config.ini

Configure MySQL 5.5

$ cd cfg/
$ echo "[mysqld]\nslow_query_log = 1" > mysql-5.5/config.cnf

4. Run

4.1 Run all

$ docker-compose up -d

4.2 Run selection

$ docker-compose up -d httpd php mysql redis

5. Project setup

Assumption:

  1. HOST_PATH_TO_HTTPD_DATADIR=./data/www
  2. TLD_SUFFIX=local
  3. Three Projects: project1, project2 and wordpress

Folder setup on your Host system:

VirtualHost directory DocumentRoot directory URL
./data/www/project1 ./data/www/project1/htdocs http://project1.local
./data/www/project2 ./data/www/project2/htdocs http://project2.local
./data/www/wordpress ./data/www/wordpress/htdocs http://wordpress.local

Each VirtualHost will serve files from the htdocs/ folder.

DNS setup on your Host system:

Project folder /etc/hosts entry
project1 127.0.0.1 project1.local
project2 127.0.0.1 project2.local
wordpress 127.0.0.1 wordpress.local

Some frameworks have a nested www directory and require you to use a symlink instead of explicitly setting a htdocs/ folder. See the CakePHP folder setup below:

$ ls -l
drwxrwxr-x 2 cytopia 4096 Jun 14 08:29 cakephp
lrwxrwxrwx 1 cytopia   11 Jun 14 08:29 htdocs -> cakephp/app/webroot/