devilbox/README.md
2017-10-16 11:33:43 +02:00

25 KiB

The devilbox

Devilbox

Join the chat at https://gitter.im/devilbox/Lobby

Usage | Features | Documentation | Intranet | Screenshots | Contributing | Logos | License

Devilbox

Build Status Tag type License

The devilbox is a modern and highly customisable dockerized PHP stack supporting full LAMP and MEAN and running on all major platforms. The main goal is to easily switch and combine any version required for local development. It supports an unlimited number of projects for which vhosts and DNS records are created automatically. Email catch-all and popular development tools will be at your service as well. Configuration is not necessary, as everything is pre-setup with mass virtual hosting.

Linux Windows OSX

Usage

Quick start

You are up and running in four simple steps:

# Get the devilbox
$ git clone https://github.com/cytopia/devilbox
$ cd devilbox

# Create docker-compose environment file
$ cp env-example .env

# Edit your configuration
$ vim .env

# Start all containers
$ docker-compose up

Selective start

The above will start all containers, you can however also just start the containers you actually need. This is achieved by simply specifying them in the docker-compose command.

$ docker-compose up httpd php mysql redis

Devilbox

Run different versions

Every single attachable container comes with many different versions. In order to select the desired version for a container, simply edit the .env file and uncomment the version of choice. Any combination is possible.

Apache Nginx PHP MySQL MariaDB Percona PgSQL Redis Memcached MongoDB
2.2 stable 5.4 5.5 5.5 5.5 9.1 2.8 1.4.21 2.8
2.4 mainline 5.5 5.6 10.0 5.6 9.2 3.0 1.4.22 3.0
5.6 5.7 10.1 5.7 9.3 3.2 1.4.23 3.2
7.0 8.0 10.2 9.4 4.0 1.4.24 3.4
7.1 10.3 9.5 ... 3.5
7.2 9.6 1.5.2
HHVM 10.0 latest

Enter the container

You can also work directly inside the php container. Simply use the bundled scripts shell.sh. The PS1 will automatically be populated with current chosen php version.

# Enter as user devilbox (normal operation / development)
host> ./shell.sh
devilbox@php-7.0.19 in /shared/httpd $
# Enter as root user (do root stuff)
host> ./shell.sh
devilbox@php-7.0.19 in /shared/httpd $ sudo su -
root@php-7.0.19 in /shared/httpd $

Your projects can be found in /shared/httpd. DNS records are automatically available inside the php container. Also every other service will be available on 127.0.0.1 inside the php container (tricky socat port-forwarding).

Quick Video intro

Devilbox setup and workflow Devilbox email catch-all

Feature overview

The devilbox has everything setup for you. The only thing you will have to install is docker and docker-compose. Virtual hosts and DNS entries will be created automatically, just by adding new project folders.

Features

Mass virtual hosts New vhosts are created automatically whenever you add a project directory. This is done internally and automatically via vhost-gen and watcherd.
Custom vhosts You can overwrite and customise the default applied vhost configuration for every single vhost.
Custom domains Choose whatever development domain you desire: *.loc, *.local, *.dev or use real domains as well: *.example.com
Auto DNS An integraded BIND server is able to create DNS entries automatically for your chosen domains.
Custom PHP config Overwrite any setting for PHP.
Custom PHP modules Load custom PHP modules on the fly.
Email catch-all All outgoing emails are catched and will be presented in the included intranet.
Self-validation Projects and configuration options are validated and marked in the intranet.
Xdebug Xdebug and a full blown PHP-FPM/HHVM server is ready to serve.
Many more See Documentation for all available features.

Batteries

📂 phpMyAdmin
📂 Adminer
📊 OpCache GUI
📧 Mail viewer

Tools

🔧 awesome-ci A set of tools for static code analysis:

`file-cr`, `file-crlf`, `file-empty`, `file-nullbyte-char`, `file-trailing-newline`, `file-trailing-single-newline`, `file-trailing-space`, `file-utf8`, `file-utf8-bom`, `git-conflicts`, `git-ignored`, `inline-css`, `inline-js`, `regex-grep`, `regex-perl`, `syntax-bash`, `syntax-css`, `syntax-js`, `syntax-json`, `syntax-markdown`, `syntax-perl`, `syntax-php`, `syntax-python`, `syntax-ruby`, `syntax-scss`, `syntax-sh`
🔧 laravel installer laravel is a command line tool that lets you easily install the Laravel framework.
🔧 phalcon devtools phalcon is a command line tool that lets you easily install the PhalconPHP framework.
🔧 symfony installer symfony is a command line tool that lets you easily install the Symfony framework.
🔧 wp-cli wp is a command line tool that lets you easily install Wordpress.

Devilbox Devilbox Devilbox Devilbox Devilbox Devilbox Devilbox

Require additional tools? Have a look at Hacking for information about how to add your own tools or open up an issue with a new tool request.

Available PHP Modules

The devilbox is a development stack, so it is made sure that a lot of PHP modules are available out of the box in order to work with many different frameworks.

apc, apcu, bcmath, bz2, calendar, Core, ctype, curl, date, dom, ereg, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, igbinary, imagick, imap, intl, json, ldap, libxml, magickwand, mbstring, mcrypt, memcache, memcached, mhash, mongodb, msgpack, mysql, mysqli, mysqlnd, openssl, pcntl, pcre, PDO, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, phalcon, Phar, posix, pspell, readline, recode, redis, Reflection, session, shmop, SimpleXML, soap, sockets, SPL, sqlite3, standard, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, uploadprogress, wddx, xdebug, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend OPcache, zip, zlib

Custom PHP Modules

You can also copy any custom modules into mod/(php-fpm|hhvm)-<VERSION> and add a custom *.ini file to load them. See Custom PHP Modules in the Configuration documentation for how to do that in two simple steps.

Supported Frameworks

As far as tested there are no limitations and you can use any Framework or CMS just as you would on your live environment. Below are a few examples of extensively tested Frameworks and CMS:

CakePHP Drupal Joomla Laravel Phalcon Symfony Wordpress Yii Zend

Documentation

  1. Overview
    1. Main idea
    2. Features
    3. Supported Host OS
    4. Requirements
    5. Docker documentation
    6. Devilbox documentation
    7. Video Tutorials
    8. Available PHP Modules
    9. Supported Frameworks and CMS
  2. Quickstart
    1. Installation
    2. Update
    3. Configuration
    4. Run
    5. Project setup
    6. Enter the PHP Docker container
  3. Install
    1. Install Docker
      1. Linux
      2. Windows
      3. OSX
    2. Install Devilbox
  4. Update
    1. TL;DR
    2. Git tag vs master branch
    3. Compare .env file
    4. Pull new Docker container (Important!)
    5. Remove anonymous volumes
  5. Configure
    1. Overview
    2. Devilbox general settings
    3. Project settings
    4. Container settings
    5. Intranet settings
    6. Host computer
  6. Run
    1. Start the devilbox
    2. Stop the devilbox
    3. Attach/Detach during run-time
    4. Docker logs
  7. Usage
    1. Mounted directories
    2. Work on the Docker host
    3. Work inside the PHP container
    4. Managing Projects explained
    5. Creating new Projects
    6. Switching container versions
    7. Emails
    8. Log files
    9. Intranet
  8. OS
    1. Linux
    2. Windows
    3. OSX
  9. Backups
    1. Info
    2. MySQL
      1. MySQL Database Backup
      2. MySQL Database Restore
    3. PostgreSQL
      1. PostgreSQL Database Backup
      2. PostgreSQL Database Restore
    4. MongoDB
      1. MongoDB Database Backup
      2. MongoDB Database Restore
  10. Examples
    1. Introduction
      1. Framework/CMS tools
      2. Code analysis tools
    2. Project setup
      1. Setup CakePHP
      2. Setup Drupal
      3. Setup Joomla
      4. Setup Laravel
      5. Setup Phalcon
      6. Setup Symfony
      7. Setup Wordpress
      8. Setup Yii
      9. Setup Zend
  11. Code analysis
    1. awesome-ci
    2. phpcs
    3. eslint
  12. Technical
    1. Networking
    2. Ports and forwarding
    3. Works the same on Host and PHP Container
  13. Hacking
    1. Rebuilding bundled Docker container
    2. Customizing the bundled Docker container
    3. Adding your own Docker container
  14. FAQ

Intranet overview

The devilbox comes with a pre-configured intranet on http://localhost. It will not only show you, your chosen configuration, but also validate the status of your configuration, such as Do DNS records exists (on host and container), are directories properly set-up. Additionally it provides external tools to let you interact with databases and emails.

  • Virtual Host overview (validates directories and DNS)
  • Database overview (MySQL, PgSQL, Redis, Memcache, ...)
  • Email overview
  • Info pages (Httpd, MySQL, PgSQL, Redis, Memcache, ...)
  • phpMyAdmin
  • Adminer
  • OpcacheGUI

Screenshots

Homepage with host / docker information

The homepage shows you the status of your current configured setup.

  • which versions are used
  • what directories are mounted
  • where does DNS point to
  • what other settings have been set
  • did any errors occur?

Intranet Home

Virtual Host overview

This overview shows you all available virtual hosts and if they need additional configuration (on the host)

Virtual Hosts are considered valid if the following requirements are met (on the host system):

  • htdocs folder/symlink exists in your project folder
  • /etc/hosts has a valid DNS config for your host: 127.0.0.1 <project-folder>.<TLD_SUFFIX> (alternatively the bundle BIND server can be attached to your host-computer).

Intranet vHost

Database overview

Shows you all the databases that are loaded

Intranet DB

Email overview

Shows you all the emails that have been sent. No email will actually be sent outside, but they are all catched by one account and presented here.

Intranet Email

Contributing

Contributers are welcome in any way.

First of all, if you like the project, please do star it. Starring is an important measurement to see the number of active users and better allows me to organize my time and effort I can put into this project.

Secondly, please do report all bugs. This will not only help you get your problem fixed, but also help others as they might encounter the same.

And last but not least, you can also get actively involved. Do clone the project and start improving whatever you think is useful. There is quite a lot todo and planned. If you like to contribute, view CONTRIBUTING.md and ROADMAP.

Major contributors will be credited within the intranet and on the github page.

Logos

Logos and banners can be found at devilbox/artwork.

License

MIT License