From 9545113e430c77b0950b530e436b342e9035de76 Mon Sep 17 00:00:00 2001 From: cytopia Date: Sat, 22 Jul 2017 11:43:07 +0200 Subject: [PATCH 01/11] DVL-012 Fix #97 Devilbox UI footer overlaps embedded tools --- .devilbox/www/htdocs/assets/css/custom.css | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.devilbox/www/htdocs/assets/css/custom.css b/.devilbox/www/htdocs/assets/css/custom.css index 0ab85e744..1ab8f6c88 100644 --- a/.devilbox/www/htdocs/assets/css/custom.css +++ b/.devilbox/www/htdocs/assets/css/custom.css @@ -71,7 +71,7 @@ html { } body { /* Margin bottom by footer height */ - margin-bottom: 80px; + margin-bottom: 80px !important; } .footer { position: absolute; @@ -190,3 +190,6 @@ td.break-word { #lang { top: 53px !important; } +.pages { + z-index:1000; +} From d6bf9692126aafa04d3501460d157d523e483b94 Mon Sep 17 00:00:00 2001 From: cytopia Date: Sat, 12 Aug 2017 11:05:39 +0200 Subject: [PATCH 02/11] DVL-012 #107 Allow to load custom PHP modules --- .gitignore | 9 +++++++++ docker-compose.yml | 4 ++++ mod/README.md | 3 +++ mod/hhvm-latest/.keepme | 0 mod/php-fpm-5.4/.keepme | 0 mod/php-fpm-5.5/.keepme | 0 mod/php-fpm-5.6/.keepme | 0 mod/php-fpm-7.0/.keepme | 0 mod/php-fpm-7.1/.keepme | 0 mod/php-fpm-7.2/.keepme | 0 10 files changed, 16 insertions(+) create mode 100644 mod/README.md create mode 100644 mod/hhvm-latest/.keepme create mode 100644 mod/php-fpm-5.4/.keepme create mode 100644 mod/php-fpm-5.5/.keepme create mode 100644 mod/php-fpm-5.6/.keepme create mode 100644 mod/php-fpm-7.0/.keepme create mode 100644 mod/php-fpm-7.1/.keepme create mode 100644 mod/php-fpm-7.2/.keepme diff --git a/.gitignore b/.gitignore index a1df2d1ec..ae4264f4f 100644 --- a/.gitignore +++ b/.gitignore @@ -44,6 +44,15 @@ /cfg/php-fpm-7.2/*.ini /cfg/hhvm-latest/*.ini +# Ignore custom PHP-FPM modules +/mod/php-fpm-5.4/*.so +/mod/php-fpm-5.5/*.so +/mod/php-fpm-5.6/*.so +/mod/php-fpm-7.0/*.so +/mod/php-fpm-7.1/*.so +/mod/php-fpm-7.2/*.so +/mod/hhvm-latest/*.so + ###################################### # GENERIC diff --git a/docker-compose.yml b/docker-compose.yml index 6bf2e6f8b..af2ab115d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -181,6 +181,10 @@ services: # to overwrite the default PHP configuration - ${DEVILBOX_PATH}/cfg/${PHP_SERVER}:/etc/php-custom.d:ro + # Mount devilbox user-defined *.so files in order + # to load custom PHP modules + - ${DEVILBOX_PATH}/mod/${PHP_SERVER}:/usr/lib64/php/custom-modules:ro + # Mount custom mass virtual hosting # (configured in /etc/${HTTPD_SERVER}/02-vhost-mass.conf) - ${HOST_PATH_HTTPD_DATADIR}:/shared/httpd diff --git a/mod/README.md b/mod/README.md new file mode 100644 index 000000000..770666b17 --- /dev/null +++ b/mod/README.md @@ -0,0 +1,3 @@ +# Devilbox user-defined PHP modules + +Use this folders to add your custom PHP modules. diff --git a/mod/hhvm-latest/.keepme b/mod/hhvm-latest/.keepme new file mode 100644 index 000000000..e69de29bb diff --git a/mod/php-fpm-5.4/.keepme b/mod/php-fpm-5.4/.keepme new file mode 100644 index 000000000..e69de29bb diff --git a/mod/php-fpm-5.5/.keepme b/mod/php-fpm-5.5/.keepme new file mode 100644 index 000000000..e69de29bb diff --git a/mod/php-fpm-5.6/.keepme b/mod/php-fpm-5.6/.keepme new file mode 100644 index 000000000..e69de29bb diff --git a/mod/php-fpm-7.0/.keepme b/mod/php-fpm-7.0/.keepme new file mode 100644 index 000000000..e69de29bb diff --git a/mod/php-fpm-7.1/.keepme b/mod/php-fpm-7.1/.keepme new file mode 100644 index 000000000..e69de29bb diff --git a/mod/php-fpm-7.2/.keepme b/mod/php-fpm-7.2/.keepme new file mode 100644 index 000000000..e69de29bb From e2c724ce23e13e29caded28c76691adefd5c9bc3 Mon Sep 17 00:00:00 2001 From: cytopia Date: Sun, 13 Aug 2017 13:36:24 +0200 Subject: [PATCH 03/11] DVL-012 Documentation: How to load custom PHP modules --- README.md | 5 ++++ docs/Configure.md | 76 +++++++++++++++++++++++++++++++++++++++++++---- docs/FAQ.md | 55 ++++++++++++++++++---------------- docs/README.md | 4 +++ 4 files changed, 110 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 592318c68..2eb3385ad 100644 --- a/README.md +++ b/README.md @@ -192,6 +192,7 @@ The devilbox has everything setup for you. The only thing you will have to insta * **Email catch-all** (Internal postfix with catch-all) * **Log files** (available on host computer) * **Config overwrites** (`my.cnf`, `nginx.conf`, `httpd.conf` or `php.ini`) +* **Custom PHP modules** * **Self-validation** (projects and configured options are validated and marked in the intranet) * **Xdebug** @@ -226,6 +227,10 @@ The devilbox is a development stack, so it is made sure that a lot of PHP module > *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)-` and add a custom `*.ini` file to load them. See [Custom PHP Modules](docs/Configure.md#425-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: diff --git a/docs/Configure.md b/docs/Configure.md index 1d52ae6e0..1524523eb 100644 --- a/docs/Configure.md +++ b/docs/Configure.md @@ -21,8 +21,10 @@ Configure | 1. [Overview](#1-overview) 1. [The devilbox `.env` file](#11-the-devilbox-env-file) 2. [The devilbox `cfg/` directory](#12-the-devilbox-cfg-directory) - 3. [The operating system `hosts` file](#13-the-operating-system-hosts-file) - 4. [The operating system `resolv.conf` file](#14-the-operating-system-resolvconf-file) + 3. [The devilbox `mod/` directory](#13-the-devilbox-mod-directory) + 1. [Custom PHP module example](#134-custom-php-module-example) + 4. [The operating system `hosts` file](#14-the-operating-system-hosts-file) + 5. [The operating system `resolv.conf` file](#15-the-operating-system-resolvconf-file) 2. [Devilbox general settings](#2-devilbox-general-settings) 1. [Verbosity](#21-verbosity) 2. [Devilbox base path](#22-devilbox-base-path) @@ -40,6 +42,7 @@ Configure | 2. [Xdebug](#422-xdebug) 3. [php.ini](#423-phpini) 4. [HHVM](#424-hhvm) + 5. [Custom PHP modules](#425-custom-php-modules) 3. [Apache / Nginx](#43-apache--nginx) 1. [Select Httpd version](#431-select-httpd-version) 2. [Host port](#432-host-port) @@ -103,7 +106,7 @@ You can get more information here: #### 1.2 The devilbox `cfg/` directory -Inside the devilbox root directory you will find a foder called `cfg/`. This will contain subdirectories in the form of `-`. Those folders will be mounted into the appropriate location into the respective docker container in order to overwrite service configuration. +Inside the devilbox root directory you will find a folder called `cfg/`. This will contain subdirectories in the form of `-`. Those folders will be mounted into the appropriate location into the respective docker container in order to overwrite service configuration. Currently only MySQL/MariaDB and PHP/HHVM overrides are supported. @@ -141,13 +144,45 @@ Only files which have the correct file extensions will be read, all others such * Valid PHP config extension: `.ini` * Valid MySQL config extension: `.cnf` -#### 1.3 The operating system `hosts` file +#### 1.3 The devilbox `mod/` directory + +Inside the devilbox root directory you will find a folder called `mod/`. This will contain subdirectories in the form of `(php-fpm|hhvm)-`. Those folders will be mounted into the appropriate location into the respective PHP docker container under `/usr/lib64/php/custom-modules/` in order to provide custom PHP modules. + +The folder structure looks like this: +``` +cfg/ + hhvm-latest/ + php-fpm-5.4/ + php-fpm-5.5/ + php-fpm-5.6/ + php-fpm-7.0/ + php-fpm-7.1/ + php-fpm-7.2/ +``` + +Each of the folders are empty by default. Place any PHP modules (`*.so`) inside the versioned folder of your choice. + +Modules placed in the above folders are not loaded by default. You will also have to enable them via your custom configuration as described in the above section. + +##### 1.3.4 Custom PHP module example + +The following example will add a custom [ioncube](https://www.ioncube.com) module for PHP 7.0: + +1. Copy `ioncube_loader_lin_7.0.so` to `mod/php-fpm-7.0/ioncube_loader_lin_7.0.so` +2. Create custom config to enable ioncube in: `cfg/php-fpm-7.0/00-ioncube.ini` +```shell +zend_extension = /usr/lib64/php/custom-modules/ioncube_loader_lin_7.0.so +``` + +**Note:** PHP configuration files are loaded by file names in alphabetical order and the ioncube zend extension needs to be loaded before any other zend extension. This is the reason why its configuration file name starts with `00-`. + +#### 1.4 The operating system `hosts` file On Linux and OSX your hosts file is located at `/etc/hosts` on Windows it will be at `C:\Windows\System32\drivers\etc`. Use this file to setup custom DNS entries if you are not using Auto-DNS. Read up on it below at `/etc/hosts` or `Auto-DNS` section. -#### 1.4 The operating system `resolv.conf` file +#### 1.5 The operating system `resolv.conf` file This file is used to add the devilbox DNS server for Auto-DNS. @@ -378,6 +413,37 @@ By default, HHVM is using **PHP-7** mode, you can change this setting to **PHP-5 **Note:** You must then also copy the file to something that ends by `*.ini`. +##### 4.2.5 Custom PHP modules + +The devilbox supports to load custom PHP modules for each version without having to rebuild the PHP containers. There are only two things to be done in order to load them: + +1. Copy your custom module to `mod/(hhvm|php-fpm)-/*.so` +2. Create a config file that loads the module in `cfg/(hhvm|php-fpm)-/*.ini` + +As you will need to state the Path of the module to be loaded in your configuration file (`*.ini`), you will need to know where those modules are placed inside the docker container. Have a look at the following table to find out: + +| Docker | Module host path | Path inside Docker container | +|---------|----------------------------|------------------------------------------| +| PHP 5.4 | `mod/php-fpm-5.4/.so` | `/usr/lib64/php/custom-modules/.so` | +| PHP 5.5 | `mod/php-fpm-5.5/.so` | `/usr/lib64/php/custom-modules/.so` | +| PHP 5.6 | `mod/php-fpm-5.6/.so` | `/usr/lib64/php/custom-modules/.so` | +| PHP 7.0 | `mod/php-fpm-7.0/.so` | `/usr/lib64/php/custom-modules/.so` | +| PHP 7.1 | `mod/php-fpm-7.1/.so` | `/usr/lib64/php/custom-modules/.so` | +| PHP 7.2 | `mod/php-fpm-7.2/.so` | `/usr/lib64/php/custom-modules/.so` | +| HHVM | `mod/hhvm-latest/.so` | `/usr/lib64/php/custom-modules/.so` | + +As you can see from the above table, modules are always available in `/usr/lib64/php/custom-modules/` and you can just copy/paste your configuration files for each PHP version. + +The following will show an example how to load [ioncube](https://www.ioncube.com) module for PHP 7.0: + +1. Copy `ioncube_loader_lin_7.0.so` to `mod/php-fpm-7.0/ioncube_loader_lin_7.0.so` +2. Create custom config to enable ioncube in: `cfg/php-fpm-7.0/00-ioncube.ini` +```shell +zend_extension = /usr/lib64/php/custom-modules/ioncube_loader_lin_7.0.so +``` + +**Note:** PHP configuration files are loaded by file names in alphabetical order and the ioncube zend extension needs to be loaded before any other zend extension. This is the reason why its configuration file name starts with `00-`. + #### 4.3 Apache / Nginx ##### 4.3.1 Select Httpd version diff --git a/docs/FAQ.md b/docs/FAQ.md index 9e10b23a8..119e5141e 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -27,36 +27,36 @@ FAQ ## 1. General -**Are there any differences between Linux, Windows and OSX?** +#### Are there any differences between Linux, Windows and OSX? Yes, have a look at **[OS](OS.md)** to read up about the differences. -**Why are mounted MySQL data directories separated by version?** +#### Why are mounted MySQL data directories separated by version? This is just a pre-caution. Imagine they would link to the same datadir. You start the devilbox with mysql 5.5, create a database and add some data. Now you decide to switch to mysql 5.7 and restart the devilbox. The newer mysql version will probably upgrade the data leaving it unable to start with older mysql versions. -**Why are mounted PostgreSQL data directories separated by version?** +#### Why are mounted PostgreSQL data directories separated by version? See: *Why are mounted MySQL data directories separated by version?* -**Why are mounted MongoDB data directories separated by version?** +#### Why are mounted MongoDB data directories separated by version? See: *Why are mounted MySQL data directories separated by version?* -**Why do the user/group permissions of log/ or cfg/ directories show 1000?** +#### Why do the user/group permissions of log/ or cfg/ directories show 1000? Uid and Gid are set to 1000 by default. You can alter them to match the uid/gid of your current user. Open the `.env` file and change the sections `NEW_UID` and `NEW_GID`. When you start up the devilbox, the php-container will use these values for its user. -**Can I not just comment out the service in the `.env` file?** +#### Can I not just comment out the service in the `.env` file? No, don't do this. This will lead to unexpected behaviour (different versions will be loaded). The `.env` file allows you to configure the devilbox, but not to start services selectively. -**Are there any required services that must/will always be started?** +#### Are there any required services that must/will always be started? Yes. `http` and `php` will automatically always be started (due to dependencies inside `docker-compose.yml`) if you specify them or not. -**What PHP Modules are available?** +#### What PHP Modules are available? 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. @@ -72,26 +72,30 @@ There will however be slight differences between the versions and especially wit [PHP 7.2](https://github.com/cytopia/docker-php-fpm-7.2) | [HHVM](https://github.com/cytopia/docker-hhvm-latest) +#### Can I load custom PHP modules without rebuilding the Docker container? + +Yes. You can load custom PHP modules for each PHP version separately. See [Custom PHP Modules](Configure.md#425-custom-php-modules) in the Configuration documentation. + ## 2. Configuration -**Can I change the MySQL root password?** +#### Can I change the MySQL root password? Yes, you can change the password of the MySQL root user. If you do so, you must also set the new password in your `.env` file. See **[Configure](Configure.md)** for how to change the values. -**Can I add other PHP Modules?** +#### Can I add other PHP Modules? Yes, if there are any PHP modules you require that are not yet available in the PHP Docker container, you can install it during run-time, or create your own container. See **[Hacking](Hacking.md)** for more information. -**Can I change php.ini?** +#### Can I change php.ini? Yes, php.ini directives can be changes on a per PHP version base. Go to `./cfg/` inside devilbox git diretory. There you will find configuration directories for each php version. Just put a \*.ini file there and restart the devilbox. -**Can I change my.cnf?** +#### Can I change my.cnf? Yes, my.cnf directives can be changes on a per MySQL version base. Go to `./cfg/` inside devilbox git diretory. There you will find configuration directories for each MySQL version. Just put a \*.cnf file there and restart the devilbox. -**Can I switch HHVM between PHP 5.6 and PHP 7 mode?** +#### Can I switch HHVM between PHP 5.6 and PHP 7 mode? Yes, this can be done by adding a \*.ini file to `./cfg/hhvm-latest/` with the following content to disable PHP 7 mode: @@ -100,7 +104,7 @@ hhvm.php7.all = 0 ``` The default is to use PHP 7 mode. -**Can I change the project virtual host domain `.loc`?** +#### Can I change the project virtual host domain `.loc`? Yes, the `.env` variable `TLD_SUFFIX` can be adjusted with whatever domain or subdomain your require. A few examples to get you started: @@ -111,52 +115,53 @@ Yes, the `.env` variable `TLD_SUFFIX` can be adjusted with whatever domain or su | project1 | dev | http://project1.dev | | project1 | work.loc | http://project1.work.loc | -**Can I just start PHP and MySQL instead of all container?** +#### Can I just start PHP and MySQL instead of all container? Yes, every Docker container is optional. The devilbox allows for selective startup. See **[Run: selective start](Run.md#13-selective-start)** for more detail. -**Do I always have to edit `/etc/hosts` for new projects?** +#### Do I always have to edit `/etc/hosts` for new projects? You need a valid DNS entry for every project that points to the Httpd server. As those records don't exists by default, you will have to create them. However, the devilbox has a bundled DNS server that can automate this for you. The only thing you have to do for that to work is to add this DNS server's IP address to your `/etc/resolv.conf`. See **[Configure: AutoDNS](Configure.md#62-auto-dns)** for instructions. + ## 3. Usage -**Does it work with CakePHP?** +#### Does it work with CakePHP? Yes, see **[How to setup CakePHP](Examples.md#2-setup-cakephp)**. -**Does it work with Drupal?** +#### Does it work with Drupal? Yes, see **[How to setup Drupal](Examples.md#3-setup-drupal)**. -**Does it work with Laravel?** +#### Does it work with Laravel? Yes, see **[How to setup Laravel](Examples.md#4-setup-laravel)**. -**Does it work with PhalconPHP?** +#### Does it work with PhalconPHP? Yes, see **[How to setup Phalcon](Examples.md#5-setup-phalcon)**. -**Does it work with Symfony?** +#### Does it work with Symfony? Yes, see **[How to setup Symfony](Examples.md#6-setup-symfony)**. -**Does it work with Wordpress?** +#### Does it work with Wordpress? Yes, see **[How to setup Wordpress](Examples.md#7-setup-wordpress)**. -**Does it work with Yii?** +#### Does it work with Yii? Yes, see **[How to setup Yii](Examples.md#8-setup-yii)**. -**Does it work with Zend Framework?** +#### Does it work with Zend Framework? Yes, see **[How to setup Zend](Examples.md#9-setup-zend)**. ## 4. Troubleshooting -**`Invalid bind mount spec` after changing the path of MySQL, PgSQL, Mongo or the Data dir.** +#### `Invalid bind mount spec` after changing the path of MySQL, PgSQL, Mongo or the Data dir. When you change any paths inside `.env` that affect Docker mountpoints, the container need to be *removed* and re-created during the next startup. *Removing* the container is sufficient as they will always be created during run if they don't exist. diff --git a/docs/README.md b/docs/README.md index 266d4e24d..c1244ecdd 100644 --- a/docs/README.md +++ b/docs/README.md @@ -79,6 +79,7 @@ New folders can be created, deleted and removed during run-time and correspondin | **Configuration** | | | HHVM | You can choose between PHP 5.6 and PHP 7 mode for HHVM | | php.ini | You an overwrite PHP settings for each PHP version. | +| Custom PHP modules | You can add any custom PHP modules without having to rebuild the Docker container. | | my.cnf | You an overwrite MySQL settings for each MySQL version. | | **Intranet** | | | phpMyAdmin | Manage your MySQL databases here. | @@ -171,6 +172,9 @@ There will however be slight differences between the versions and especially wit [PHP 7.2](https://github.com/cytopia/docker-php-fpm-7.2) | [HHVM](https://github.com/cytopia/docker-hhvm-latest) +** Custom PHP Modules** + +Apart from asking for new modules to be bundled with each Docker container, you can simply also just place any missing modules into `mod/(php-fpm|hhvm)-` and add a custom `*.ini` file to load them. See [Custom PHP Modules](Configure.md#425-custom-php-modules) in the Configuration documentation for how to do that in two simple steps. ## 9. Supported Frameworks and CMS From bcfa689fab5280b76f86a89873c49a0017838134 Mon Sep 17 00:00:00 2001 From: cytopia Date: Sun, 13 Aug 2017 13:56:37 +0200 Subject: [PATCH 04/11] DVL-012 Documentation: Add ToC for FAQ section --- docs/FAQ.md | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/docs/FAQ.md b/docs/FAQ.md index 119e5141e..8a45cc2ec 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -18,10 +18,36 @@ FAQ ## FAQ -1. [General](#1-general) -2. [Configuration](#2-configuration) -3. [Usage](#3-usage) -4. [Troubleshooting](#4-troubleshooting) +1. **[General](#1-general)** + - [Are there any differences between Linux, Windows and OSX?](#are-there-any-differences-between-linux-windows-and-osx) + - [Why are mounted MySQL data directories separated by version?](#why-are-mounted-mysql-data-directories-separated-by-version) + - [Why are mounted PostgreSQL data directories separated by version?](#why-are-mounted-postgresql-data-directories-separated-by-version) + - [Why are mounted MongoDB data directories separated by version?](#why-are-mounted-mongodb-data-directories-separated-by-version) + - [Why do the user/group permissions of log/ or cfg/ directories show 1000?](#why-do-the-usergroup-permissions-of-log-or-cfg-directories-show-1000) + - [Can I not just comment out the service in the .env file?](#can-i-not-just-comment-out-the-service-in-the-env-file) + - [Are there any required services that must/will always be started?](#are-there-any-required-services-that-mustwill-always-be-started) + - [What PHP Modules are available?](#what-php-modules-are-available) + - [Can I load custom PHP modules without rebuilding the Docker container?](#can-i-load-custom-php-modules-without-rebuilding-the-docker-container) +2. **[Configuration](#2-configuration)** + - [Can I change the MySQL root password?](#can-i-change-the-mysql-root-password) + - [Can I add other PHP Modules?](#can-i-add-other-php-modules) + - [Can I change php.ini?](#can-i-change-phpini) + - [Can I change my.cnf?](#can-i-change-mycnf) + - [Can I switch HHVM between PHP 5.6 and PHP 7 mode?](#can-i-switch-hhvm-between-php-56-and-php-7-mode) + - [Can I change the project virtual host domain .loc?](#can-i-change-the-project-virtual-host-domain-loc) + - [Can I just start PHP and MySQL instead of all container?](#can-i-just-start-php-and-mysql-instead-of-all-container) + - [Do I always have to edit /etc/hosts for new projects?](#do-i-always-have-to-edit-etchosts-for-new-projects) +3. **[Usage](#3-usage)** + - [Does it work with CakePHP?](#does-it-work-with-cakephp) + - [Does it work with Drupal?](#does-it-work-with-drupal) + - [Does it work with Laravel?](#does-it-work-with-laravel) + - [Does it work with PhalconPHP?](#does-it-work-with-phalconphp) + - [Does it work with Symfony?](#does-it-work-with-symfony) + - [Does it work with Wordpress?](#does-it-work-with-wordpress) + - [Does it work with Yii?](#does-it-work-with-yii) + - [Does it work with Zend Framework?](#does-it-work-with-zend-framework) +4. **[Troubleshooting](#4-troubleshooting)** + - [Invalid bind mount spec after changing the path of MySQL, PgSQL, Mongo or the Data dir.](#invalid-bind-mount-spec-after-changing-the-path-of-mysql-pgsql-mongo-or-the-data-dir) --- From b2ebe2df0af022d3c5c7dfad9540326192a6833c Mon Sep 17 00:00:00 2001 From: cytopia Date: Wed, 16 Aug 2017 09:16:58 +0200 Subject: [PATCH 05/11] DVL-012 Add documentation for awesome-ci --- .devilbox/www/config.php | 2 +- README.md | 24 ++++--- docs/Examples.md | 135 ++++++++++++++++++++++++++++++++++----- docs/FAQ.md | 16 ++--- docs/Quickstart.md | 18 +++--- 5 files changed, 152 insertions(+), 43 deletions(-) diff --git a/.devilbox/www/config.php b/.devilbox/www/config.php index 8fbb648b6..b44c07407 100644 --- a/.devilbox/www/config.php +++ b/.devilbox/www/config.php @@ -11,7 +11,7 @@ $DEVILBOX_VERSION = 'v0.11'; -$DEVILBOX_DATE = '2017-06-25'; +$DEVILBOX_DATE = '2017-08-16'; $DEVILBOX_API_PAGE = 'devilbox-api/status.json'; // diff --git a/README.md b/README.md index 2eb3385ad..9a6df1357 100644 --- a/README.md +++ b/README.md @@ -207,6 +207,7 @@ The devilbox has everything setup for you. The only thing you will have to insta | tool | binary | |----------------|---------| +| [awesome-ci](https://github.com/cytopia/awesome-ci) | `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` | | [composer](https://getcomposer.org) | `composer` | | [drupal-console](https://drupalconsole.com) | `drupal` | | [drush](http://www.drush.org) | `drush` | @@ -344,14 +345,21 @@ The devilbox documentation consists of the following main sections. 2. [MongoDB Database Restore](docs/Backups.md#4-1-mongodb-database-restore) 10. **[Examples](docs/Examples.md)** 1. [Introduction](docs/Examples.md#1-introduction) - 2. [Setup CakePHP](docs/Examples.md#2-setup-cakephp) - 3. [Setup Drupal](docs/Examples.md#3-setup-drupal) - 4. [Setup Laravel](docs/Examples.md#4-setup-laravel) - 5. [Setup Phalcon](docs/Examples.md#5-setup-phalcon) - 6. [Setup Symfony](docs/Examples.md#6-setup-symfony) - 7. [Setup Wordpress](docs/Examples.md#7-setup-wordpress) - 8. [Setup Yii](docs/Examples.md#8-setup-yii) - 9. [Setup Zend](docs/Examples.md#9-setup-zend) + 1. [Framework/CMS tools](docs/Examples.md#1-1-framework-cms-tools) + 2. [Code analysis tools](docs/Examples.md#1-2-code-analysis-tools) + 2. [Project setup](docs/Examples.md#2-project-setup) + 2. [Setup CakePHP](docs/Examples.md#2-1-setup-cakephp) + 3. [Setup Drupal](docs/Examples.md#2-2-setup-drupal) + 4. [Setup Laravel](docs/Examples.md#2-3-setup-laravel) + 5. [Setup Phalcon](docs/Examples.md#2-4-setup-phalcon) + 6. [Setup Symfony](docs/Examples.md#2-5-setup-symfony) + 7. [Setup Wordpress](docs/Examples.md#2-6-setup-wordpress) + 8. [Setup Yii](docs/Examples.md#2-7-setup-yii) + 9. [Setup Zend](docs/Examples.md#2-8-setup-zend) + 3. [Code analysis](docs/Examples.md#3-code-analysis) + 1. [awesome-ci](docs/Examples.md#3-1-awesome-ci) + 2. [phpcs](docs/Examples.md#3-2-phpcs) + 3. [eslint](docs/Examples.md#3-3-eslint) 11. **[Technical](docs/Technical.md)** 1. [Networking](docs/Technical.md#1-networking) 2. [Ports and forwarding](docs/Technical.md#2-ports-and-forwarding) diff --git a/docs/Examples.md b/docs/Examples.md index 311dc8edf..6fcb93605 100644 --- a/docs/Examples.md +++ b/docs/Examples.md @@ -19,20 +19,31 @@ Examples | ## Examples 1. [Introduction](#1-introduction) -2. [Setup CakePHP](#2-setup-cakephp) -3. [Setup Drupal](#3-setup-drupal) -4. [Setup Laravel](#4-setup-laravel) -5. [Setup Phalcon](#5-setup-phalcon) -6. [Setup Symfony](#6-setup-symfony) -7. [Setup Wordpress](#7-setup-wordpress) -8. [Setup Yii](#8-setup-yii) -9. [Setup Zend](#9-setup-zend) + 1. [Framework/CMS tools](#1-1-framework-cms-tools) + 2. [Code analysis tools](#1-2-code-analysis-tools) +2. [Project setup](#2-project-setup) + 1. [Setup CakePHP](#2-1-setup-cakephp) + 2. [Setup Drupal](#2-2-setup-drupal) + 3. [Setup Laravel](#2-3-setup-laravel) + 4. [Setup Phalcon](#2-4-setup-phalcon) + 5. [Setup Symfony](#2-5-setup-symfony) + 6. [Setup Wordpress](#2-6-setup-wordpress) + 7. [Setup Yii](#2-7-setup-yii) + 8. [Setup Zend](#2-8-setup-zend) +3. [Code analysis](#3-code-analysis) + 1. [awesome-ci](#3-1-awesome-ci) + 2. [phpcs](#3-2-phpcs) + 3. [eslint](#3-3-eslint) --- ## 1. Introduction -The devilbox provides popular tools for setting up and managing major frameworks or content management systems. The following bundled tools are available: +The devilbox provides popular tools for setting up and managing major frameworks or content management systems, as well as tools for static code analysis. The following bundled tools are available inside each PHP|HHVM Docker container: + +#### 1.1 Framework/CMS tools + +You can use the following tools to setup or manage your Frameworks/CMS. | Binary | Tool name | Framework/CMS | |------------|-------------------|--------------------| @@ -45,8 +56,20 @@ The devilbox provides popular tools for setting up and managing major frameworks | `symfony` | [symfony installer](https://github.com/symfony/symfony-installer) | Symfony | | `wp` | [wp-cli](https://wp-cli.org/) | Wordpress | +#### 1.2 Code analysis tools + +You can use the following tools to analyse and fix your source code files. + +| Binary | Tool name | Description | +|------------|-------------------|--------------------| +| `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` | [awesome-ci](https://github.com/cytopia/awesome-ci) | General file, code and repository analysis and linting (Some of them also support to fix the problems) | +| `phpcs` | [phpcs](https://github.com/squizlabs/PHP_CodeSniffer) | Lint and optionally fix your PHP files | +| `eslint` | [eslint](http://eslint.org/) | Lint and optionally fix your JS files | -## 2. Setup CakePHP + +## 2. Project Setup + +#### 2.1 Setup CakePHP > **[Official CakePHP Documentation](https://book.cakephp.org/3.0/en/installation.html)** @@ -121,7 +144,7 @@ If you do not have auto-DNS configured, you will need to add the following line All set now, you can visit http://my-cake.loc in your browser. -## 3. Setup Drupal +#### 2.2 Setup Drupal > **[Official Drupal Documentation](https://www.drupal.org/docs/7/install)** @@ -169,7 +192,7 @@ Open your browser at http://my-drupal.loc and follow the Drupal installation ste **Note:** For MySQL host choose `127.0.0.1`. -## 4. Setup Laravel +#### 2.3 Setup Laravel > **[Official Laravel Documentation](https://laravel.com/docs/5.4/installation)** @@ -215,7 +238,7 @@ If you do not have auto-DNS configured, you will need to add the following line Open your browser at http://my-laravel.loc -## 5. Setup Phalcon +#### 2.4 Setup Phalcon > **[Official Phalcon Documentation](https://docs.phalconphp.com/en/3.2/devtools-usage)** @@ -261,7 +284,7 @@ If you do not have auto-DNS configured, you will need to add the following line Open your browser at http://my-phalcon.loc -## 6. Setup Symfony +#### 2.5 Setup Symfony > **[Official Symfony Documentation](https://symfony.com/doc/current/setup.html)** @@ -312,7 +335,7 @@ If you do not have auto-DNS configured, you will need to add the following line Open your browser at http://my-symfony.loc -## 7. Setup Wordpress +#### 2.6 Setup Wordpress > **[Official Wordpress Documentation](https://codex.wordpress.org/Installing_WordPress)** @@ -358,7 +381,7 @@ If you do not have auto-DNS configured, you will need to add the following line Open your browser at http://my-wp.loc -## 8. Setup Yii +#### 2.7 Setup Yii > **[Official Yii Documentation](http://www.yiiframework.com/doc-2.0/guide-start-installation.html)** @@ -404,7 +427,7 @@ If you do not have auto-DNS configured, you will need to add the following line Open your browser at http://my-yii.loc -## 9. Setup Zend +#### 2.8 Setup Zend > **[Official Zend Documentation](https://docs.zendframework.com/tutorials/getting-started/skeleton-application/)** @@ -448,3 +471,81 @@ If you do not have auto-DNS configured, you will need to add the following line **6. Open your browser** Open your browser at http://my-zend.loc + + +## 3. Code analysis + +#### 3.1 awesome-ci + +**[awesome-ci](https://github.com/cytopia/awesome-ci)** is a collection of tools for analysing your workspace and its files. You can for example check for: + +* git conflicts +* git ignored files that have not been removed from the git index +* trailing spaces and newlines +* non-utf8 files or utf8 files with bom +* windows line feeds +* null-byte characters +* empty files +* syntax errors for various languages +* inline css or js code +* customized regex + +Some of the bundled tools allow for automatic fixing. See the project page for how to use it: [https://github.com/cytopia/awesome-ci](https://github.com/cytopia/awesome-ci). + +The following shows an example how to use it with the devilbox: + +```shell +# 1. Enter your PHP/HHVM container +host> ./bash + +# 2. Go to your project folder +devilbox@php-7.0.20 $ cd /shared/httpd/my-project + +# 3. Run the tools +devilbox@php-7.0.20 $ git-conflicts --path=. +devilbox@php-7.0.20 $ git-ignored --path=. +devilbox@php-7.0.20 $ file-cr --path=. +devilbox@php-7.0.20 $ file-crlf --path=. +devilbox@php-7.0.20 $ file-empty --path=. + +# 4. Run tools with more options +devilbox@php-7.0.20 $ syntax-php --path=. --extension=php +devilbox@php-7.0.20 $ syntax-php --path=. --shebang=php +... +``` + +#### 3.2 phpcs + +**[phpcs](https://github.com/squizlabs/PHP_CodeSniffer)** is also available the devilbox: + +```shell +# 1. Enter your PHP/HHVM container +host> ./bash + +# 2. Go to your project folder +devilbox@php-7.0.20 $ cd /shared/httpd/my-project + +# 3. Run it +devilbox@php-7.0.20 $ phpcs . +``` + +For more details visit its project page [https://github.com/squizlabs/PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer). + + +#### 3.3 eslint + + +**[eslint](http://eslint.org/)** is also available the devilbox: + +```shell +# 1. Enter your PHP/HHVM container +host> ./bash + +# 2. Go to your project folder +devilbox@php-7.0.20 $ cd /shared/httpd/my-project + +# 3. Run it +devilbox@php-7.0.20 $ eslint . +``` + +For more details visit its project page [http://eslint.org](http://eslint.org). diff --git a/docs/FAQ.md b/docs/FAQ.md index 8a45cc2ec..7ae9340fc 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -154,35 +154,35 @@ You need a valid DNS entry for every project that points to the Httpd server. As #### Does it work with CakePHP? -Yes, see **[How to setup CakePHP](Examples.md#2-setup-cakephp)**. +Yes, see **[How to setup CakePHP](Examples.md#2-1-setup-cakephp)**. #### Does it work with Drupal? -Yes, see **[How to setup Drupal](Examples.md#3-setup-drupal)**. +Yes, see **[How to setup Drupal](Examples.md#2-2-setup-drupal)**. #### Does it work with Laravel? -Yes, see **[How to setup Laravel](Examples.md#4-setup-laravel)**. +Yes, see **[How to setup Laravel](Examples.md#2-3-setup-laravel)**. #### Does it work with PhalconPHP? -Yes, see **[How to setup Phalcon](Examples.md#5-setup-phalcon)**. +Yes, see **[How to setup Phalcon](Examples.md#2-4-setup-phalcon)**. #### Does it work with Symfony? -Yes, see **[How to setup Symfony](Examples.md#6-setup-symfony)**. +Yes, see **[How to setup Symfony](Examples.md#2-5-setup-symfony)**. #### Does it work with Wordpress? -Yes, see **[How to setup Wordpress](Examples.md#7-setup-wordpress)**. +Yes, see **[How to setup Wordpress](Examples.md#2-6-setup-wordpress)**. #### Does it work with Yii? -Yes, see **[How to setup Yii](Examples.md#8-setup-yii)**. +Yes, see **[How to setup Yii](Examples.md#2-7-setup-yii)**. #### Does it work with Zend Framework? -Yes, see **[How to setup Zend](Examples.md#9-setup-zend)**. +Yes, see **[How to setup Zend](Examples.md#2-8-setup-zend)**. ## 4. Troubleshooting diff --git a/docs/Quickstart.md b/docs/Quickstart.md index a4995bd1d..7266823e7 100644 --- a/docs/Quickstart.md +++ b/docs/Quickstart.md @@ -188,15 +188,15 @@ lrwxrwxrwx 1 cytopia 11 Jun 14 08:29 htdocs -> cakephp/app/webroot/ To quickly find setup instructions for your framework of choice head over to **[Examples](Examples.md)**: -> 1. [Introduction](Examples.md#1-introduction) -> 2. [Setup CakePHP](Examples.md#2-setup-cakephp) -> 3. [Setup Drupal](Examples.md#3-setup-drupal) -> 4. [Setup Laravel](Examples.md#4-setup-laravel) -> 5. [Setup Phalcon](Examples.md#5-setup-phalcon) -> 6. [Setup Symfony](Examples.md#6-setup-symfony) -> 7. [Setup Wordpress](Examples.md#7-setup-wordpress) -> 8. [Setup Yii](Examples.md#8-setup-yii) -> 9. [Setup Zend](Examples.md#9-setup-zend) +> 2. [Project setup](Examples.md#2-project-setup) +> 1. [Setup CakePHP](Examples.md#2-1-setup-cakephp) +> 2. [Setup Drupal](Examples.md#2-2-setup-drupal) +> 3. [Setup Laravel](Examples.md#2-3-setup-laravel) +> 4. [Setup Phalcon](Examples.md#2-4-setup-phalcon) +> 5. [Setup Symfony](Examples.md#2-5-setup-symfony) +> 6. [Setup Wordpress](Examples.md#2-6-setup-wordpress) +> 7. [Setup Yii](Examples.md#2-7-setup-yii) +> 8. [Setup Zend](Examples.md#2-8-setup-zend) ## 6. Enter the PHP Docker container From b6be2332415d43435b0a139312cf13c444562027 Mon Sep 17 00:00:00 2001 From: cytopia Date: Wed, 16 Aug 2017 09:21:48 +0200 Subject: [PATCH 06/11] DVL-012 Fix ToC --- README.md | 44 ++++++++++++++++++++++---------------------- docs/Examples.md | 26 +++++++++++++------------- docs/FAQ.md | 16 ++++++++-------- docs/Quickstart.md | 16 ++++++++-------- 4 files changed, 51 insertions(+), 51 deletions(-) diff --git a/README.md b/README.md index 9a6df1357..21aad1f06 100644 --- a/README.md +++ b/README.md @@ -296,9 +296,9 @@ The devilbox documentation consists of the following main sections. 6. [Enter the PHP Docker container](docs/Quickstart.md#6-enter-the-php-docker-container) 3. **[Install](docs/Install.md)** 1. [Install Docker](docs/Install.md#1-install-docker) - 1. [Linux](docs/Install.md#1-1-linux) - 2. [Windows](docs/Install.md#1-2-windows) - 3. [OSX](docs/Install.md#1-3-osx) + 1. [Linux](docs/Install.md#11-linux) + 2. [Windows](docs/Install.md#12-windows) + 3. [OSX](docs/Install.md#13-osx) 2. [Install Devilbox](#2-install-devilbox) 4. **[Update](docs/Update.md)** 1. [TL;DR](docs/Update.md#1-tl-dr) @@ -335,31 +335,31 @@ The devilbox documentation consists of the following main sections. 9. **[Backups](docs/Backups.md)** 1. [Info](docs/Backups.md#1-info) 2. [MySQL](docs/Backups.md#2-mysql) - 1. [MySQL Database Backup](docs/Backups.md#2-1-mysql-database-backup) - 2. [MySQL Database Restore](docs/Backups.md#2-2-mysql-database-restore) + 1. [MySQL Database Backup](docs/Backups.md#21-mysql-database-backup) + 2. [MySQL Database Restore](docs/Backups.md#22-mysql-database-restore) 3. [PostgreSQL](docs/Backups.md#3-postgresql) - 1. [PostgreSQL Database Backup](docs/Backups.md#3-1-postgresql-database-backup) - 2. [PostgreSQL Database Restore](docs/Backups.md#3-1-postgresql-database-restore) + 1. [PostgreSQL Database Backup](docs/Backups.md#31-postgresql-database-backup) + 2. [PostgreSQL Database Restore](docs/Backups.md#31-postgresql-database-restore) 4. [MongoDB](docs/Backups.md#4-mongodb) - 1. [MongoDB Database Backup](docs/Backups.md#4-1-mongodb-database-backup) - 2. [MongoDB Database Restore](docs/Backups.md#4-1-mongodb-database-restore) + 1. [MongoDB Database Backup](docs/Backups.md#41-mongodb-database-backup) + 2. [MongoDB Database Restore](docs/Backups.md#41-mongodb-database-restore) 10. **[Examples](docs/Examples.md)** 1. [Introduction](docs/Examples.md#1-introduction) - 1. [Framework/CMS tools](docs/Examples.md#1-1-framework-cms-tools) - 2. [Code analysis tools](docs/Examples.md#1-2-code-analysis-tools) + 1. [Framework/CMS tools](docs/Examples.md#11-framework-cms-tools) + 2. [Code analysis tools](docs/Examples.md#12-code-analysis-tools) 2. [Project setup](docs/Examples.md#2-project-setup) - 2. [Setup CakePHP](docs/Examples.md#2-1-setup-cakephp) - 3. [Setup Drupal](docs/Examples.md#2-2-setup-drupal) - 4. [Setup Laravel](docs/Examples.md#2-3-setup-laravel) - 5. [Setup Phalcon](docs/Examples.md#2-4-setup-phalcon) - 6. [Setup Symfony](docs/Examples.md#2-5-setup-symfony) - 7. [Setup Wordpress](docs/Examples.md#2-6-setup-wordpress) - 8. [Setup Yii](docs/Examples.md#2-7-setup-yii) - 9. [Setup Zend](docs/Examples.md#2-8-setup-zend) + 2. [Setup CakePHP](docs/Examples.md#21-setup-cakephp) + 3. [Setup Drupal](docs/Examples.md#22-setup-drupal) + 4. [Setup Laravel](docs/Examples.md#23-setup-laravel) + 5. [Setup Phalcon](docs/Examples.md#24-setup-phalcon) + 6. [Setup Symfony](docs/Examples.md#25-setup-symfony) + 7. [Setup Wordpress](docs/Examples.md#26-setup-wordpress) + 8. [Setup Yii](docs/Examples.md#27-setup-yii) + 9. [Setup Zend](docs/Examples.md#28-setup-zend) 3. [Code analysis](docs/Examples.md#3-code-analysis) - 1. [awesome-ci](docs/Examples.md#3-1-awesome-ci) - 2. [phpcs](docs/Examples.md#3-2-phpcs) - 3. [eslint](docs/Examples.md#3-3-eslint) + 1. [awesome-ci](docs/Examples.md#31-awesome-ci) + 2. [phpcs](docs/Examples.md#32-phpcs) + 3. [eslint](docs/Examples.md#33-eslint) 11. **[Technical](docs/Technical.md)** 1. [Networking](docs/Technical.md#1-networking) 2. [Ports and forwarding](docs/Technical.md#2-ports-and-forwarding) diff --git a/docs/Examples.md b/docs/Examples.md index 6fcb93605..4a3a94b87 100644 --- a/docs/Examples.md +++ b/docs/Examples.md @@ -19,21 +19,21 @@ Examples | ## Examples 1. [Introduction](#1-introduction) - 1. [Framework/CMS tools](#1-1-framework-cms-tools) - 2. [Code analysis tools](#1-2-code-analysis-tools) + 1. [Framework/CMS tools](#11-framework-cms-tools) + 2. [Code analysis tools](#12-code-analysis-tools) 2. [Project setup](#2-project-setup) - 1. [Setup CakePHP](#2-1-setup-cakephp) - 2. [Setup Drupal](#2-2-setup-drupal) - 3. [Setup Laravel](#2-3-setup-laravel) - 4. [Setup Phalcon](#2-4-setup-phalcon) - 5. [Setup Symfony](#2-5-setup-symfony) - 6. [Setup Wordpress](#2-6-setup-wordpress) - 7. [Setup Yii](#2-7-setup-yii) - 8. [Setup Zend](#2-8-setup-zend) + 1. [Setup CakePHP](#21-setup-cakephp) + 2. [Setup Drupal](#22-setup-drupal) + 3. [Setup Laravel](#23-setup-laravel) + 4. [Setup Phalcon](#24-setup-phalcon) + 5. [Setup Symfony](#25-setup-symfony) + 6. [Setup Wordpress](#26-setup-wordpress) + 7. [Setup Yii](#27-setup-yii) + 8. [Setup Zend](#28-setup-zend) 3. [Code analysis](#3-code-analysis) - 1. [awesome-ci](#3-1-awesome-ci) - 2. [phpcs](#3-2-phpcs) - 3. [eslint](#3-3-eslint) + 1. [awesome-ci](#31-awesome-ci) + 2. [phpcs](#32-phpcs) + 3. [eslint](#33-eslint) --- diff --git a/docs/FAQ.md b/docs/FAQ.md index 7ae9340fc..af5ac997d 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -154,35 +154,35 @@ You need a valid DNS entry for every project that points to the Httpd server. As #### Does it work with CakePHP? -Yes, see **[How to setup CakePHP](Examples.md#2-1-setup-cakephp)**. +Yes, see **[How to setup CakePHP](Examples.md#21-setup-cakephp)**. #### Does it work with Drupal? -Yes, see **[How to setup Drupal](Examples.md#2-2-setup-drupal)**. +Yes, see **[How to setup Drupal](Examples.md#22-setup-drupal)**. #### Does it work with Laravel? -Yes, see **[How to setup Laravel](Examples.md#2-3-setup-laravel)**. +Yes, see **[How to setup Laravel](Examples.md#23-setup-laravel)**. #### Does it work with PhalconPHP? -Yes, see **[How to setup Phalcon](Examples.md#2-4-setup-phalcon)**. +Yes, see **[How to setup Phalcon](Examples.md#24-setup-phalcon)**. #### Does it work with Symfony? -Yes, see **[How to setup Symfony](Examples.md#2-5-setup-symfony)**. +Yes, see **[How to setup Symfony](Examples.md#25-setup-symfony)**. #### Does it work with Wordpress? -Yes, see **[How to setup Wordpress](Examples.md#2-6-setup-wordpress)**. +Yes, see **[How to setup Wordpress](Examples.md#26-setup-wordpress)**. #### Does it work with Yii? -Yes, see **[How to setup Yii](Examples.md#2-7-setup-yii)**. +Yes, see **[How to setup Yii](Examples.md#27-setup-yii)**. #### Does it work with Zend Framework? -Yes, see **[How to setup Zend](Examples.md#2-8-setup-zend)**. +Yes, see **[How to setup Zend](Examples.md#28-setup-zend)**. ## 4. Troubleshooting diff --git a/docs/Quickstart.md b/docs/Quickstart.md index 7266823e7..1a98012ba 100644 --- a/docs/Quickstart.md +++ b/docs/Quickstart.md @@ -189,14 +189,14 @@ lrwxrwxrwx 1 cytopia 11 Jun 14 08:29 htdocs -> cakephp/app/webroot/ To quickly find setup instructions for your framework of choice head over to **[Examples](Examples.md)**: > 2. [Project setup](Examples.md#2-project-setup) -> 1. [Setup CakePHP](Examples.md#2-1-setup-cakephp) -> 2. [Setup Drupal](Examples.md#2-2-setup-drupal) -> 3. [Setup Laravel](Examples.md#2-3-setup-laravel) -> 4. [Setup Phalcon](Examples.md#2-4-setup-phalcon) -> 5. [Setup Symfony](Examples.md#2-5-setup-symfony) -> 6. [Setup Wordpress](Examples.md#2-6-setup-wordpress) -> 7. [Setup Yii](Examples.md#2-7-setup-yii) -> 8. [Setup Zend](Examples.md#2-8-setup-zend) +> 1. [Setup CakePHP](Examples.md#21-setup-cakephp) +> 2. [Setup Drupal](Examples.md#22-setup-drupal) +> 3. [Setup Laravel](Examples.md#23-setup-laravel) +> 4. [Setup Phalcon](Examples.md#24-setup-phalcon) +> 5. [Setup Symfony](Examples.md#25-setup-symfony) +> 6. [Setup Wordpress](Examples.md#26-setup-wordpress) +> 7. [Setup Yii](Examples.md#27-setup-yii) +> 8. [Setup Zend](Examples.md#28-setup-zend) ## 6. Enter the PHP Docker container From f5792f1bade9f3afd3f58b298d9d4781f5ca1a0e Mon Sep 17 00:00:00 2001 From: cytopia Date: Wed, 16 Aug 2017 20:23:59 +0200 Subject: [PATCH 07/11] DVL-012 Fix ToC on README.md --- README.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 21aad1f06..e4f297910 100644 --- a/README.md +++ b/README.md @@ -345,21 +345,21 @@ The devilbox documentation consists of the following main sections. 2. [MongoDB Database Restore](docs/Backups.md#41-mongodb-database-restore) 10. **[Examples](docs/Examples.md)** 1. [Introduction](docs/Examples.md#1-introduction) - 1. [Framework/CMS tools](docs/Examples.md#11-framework-cms-tools) - 2. [Code analysis tools](docs/Examples.md#12-code-analysis-tools) - 2. [Project setup](docs/Examples.md#2-project-setup) - 2. [Setup CakePHP](docs/Examples.md#21-setup-cakephp) - 3. [Setup Drupal](docs/Examples.md#22-setup-drupal) - 4. [Setup Laravel](docs/Examples.md#23-setup-laravel) - 5. [Setup Phalcon](docs/Examples.md#24-setup-phalcon) - 6. [Setup Symfony](docs/Examples.md#25-setup-symfony) - 7. [Setup Wordpress](docs/Examples.md#26-setup-wordpress) - 8. [Setup Yii](docs/Examples.md#27-setup-yii) - 9. [Setup Zend](docs/Examples.md#28-setup-zend) - 3. [Code analysis](docs/Examples.md#3-code-analysis) - 1. [awesome-ci](docs/Examples.md#31-awesome-ci) - 2. [phpcs](docs/Examples.md#32-phpcs) - 3. [eslint](docs/Examples.md#33-eslint) + 1. [Framework/CMS tools](docs/Examples.md#11-framework-cms-tools) + 2. [Code analysis tools](docs/Examples.md#12-code-analysis-tools) + 2. [Project setup](docs/Examples.md#2-project-setup) + 1. [Setup CakePHP](docs/Examples.md#21-setup-cakephp) + 2. [Setup Drupal](docs/Examples.md#22-setup-drupal) + 3. [Setup Laravel](docs/Examples.md#23-setup-laravel) + 4. [Setup Phalcon](docs/Examples.md#24-setup-phalcon) + 5. [Setup Symfony](docs/Examples.md#25-setup-symfony) + 6. [Setup Wordpress](docs/Examples.md#26-setup-wordpress) + 7. [Setup Yii](docs/Examples.md#27-setup-yii) + 8. [Setup Zend](docs/Examples.md#28-setup-zend) + 3. [Code analysis](docs/Examples.md#3-code-analysis) + 1. [awesome-ci](docs/Examples.md#31-awesome-ci) + 2. [phpcs](docs/Examples.md#32-phpcs) + 3. [eslint](docs/Examples.md#33-eslint) 11. **[Technical](docs/Technical.md)** 1. [Networking](docs/Technical.md#1-networking) 2. [Ports and forwarding](docs/Technical.md#2-ports-and-forwarding) From 4cabfeccec7b6cf1116dacbb5b0ae1786a6bb41b Mon Sep 17 00:00:00 2001 From: cytopia Date: Thu, 17 Aug 2017 08:30:18 +0200 Subject: [PATCH 08/11] DVL-012 #112 Fixes wrong docker-compose var for BIND --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index af2ab115d..64bbea4bc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -50,7 +50,7 @@ services: ## - WILDCARD_DOMAIN=${TLD_SUFFIX:-loc} - WILDCARD_ADDRESS=172.16.238.11 - - BIND_DNS_RESOLVER=${BIND_DNS_RESOLVER:-8.8.8.8,8.8.4.4} + - DNS_FORWARDER=${BIND_DNS_RESOLVER:-8.8.8.8,8.8.4.4} dns: - 127.0.0.1 From 8f75590e8d28ff2317534afad3a3ac40f0a1dc9e Mon Sep 17 00:00:00 2001 From: cytopia Date: Thu, 17 Aug 2017 08:37:53 +0200 Subject: [PATCH 09/11] DVL-012 Name correct required Docker version in documentation --- docs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index c1244ecdd..446c83a3c 100644 --- a/docs/README.md +++ b/docs/README.md @@ -120,7 +120,7 @@ The devilbox has not been tested on FreeBSD yet. Current milestones include to m * **Internet connection** - only required during initial setup for cloning the devilbox repository and pulling the required docker container. Afterwards you can always work offline. * [Docker Engine 1.12.0+](https://docs.docker.com/compose/compose-file/compose-versioning/#version-21) -* [Docker Compose 1.6.0+](https://docs.docker.com/compose/compose-file/compose-versioning/#version-2) +* [Docker Compose 1.9.0+](https://docs.docker.com/compose/compose-file/compose-versioning/#version-21) * On Windows use [Docker for Windows][d4w] (not tested on [Docker Toolbox][dtb]) * On OSX use [Docker for Mac][d4m] (not tested on [Docker Toolbox][dtb]) From bb0a15f4e6f5abbce076fe1abac0d469c7b6c70f Mon Sep 17 00:00:00 2001 From: cytopia Date: Thu, 17 Aug 2017 21:20:41 +0200 Subject: [PATCH 10/11] DVL-012 be able to customize bash config files --- .gitignore | 4 ++++ README.md | 7 ++++--- bash/README.md | 0 bash/bashrc.sh-example | 14 ++++++++++++++ docker-compose.yml | 3 +++ docs/Backups.md | 22 +++++++++++----------- docs/Examples.md | 16 ++++++++-------- docs/Quickstart.md | 2 +- docs/Usage.md | 9 +++++---- root_bash.sh | 4 ---- bash.sh => shell.sh | 0 11 files changed, 50 insertions(+), 31 deletions(-) create mode 100644 bash/README.md create mode 100644 bash/bashrc.sh-example delete mode 100755 root_bash.sh rename bash.sh => shell.sh (100%) diff --git a/.gitignore b/.gitignore index ae4264f4f..593424192 100644 --- a/.gitignore +++ b/.gitignore @@ -53,6 +53,10 @@ /mod/php-fpm-7.2/*.so /mod/hhvm-latest/*.so +# Ignore custom bash and other confi files +/bash/* +!/bash/bashrc.sh-example +!/bash/README.md ###################################### # GENERIC diff --git a/README.md b/README.md index e4f297910..06629e207 100644 --- a/README.md +++ b/README.md @@ -165,15 +165,16 @@ Every single attachable container comes with many different versions. In order t #### Enter the container -You can also work directly inside the php container. Simply use the bundled scripts `bash.sh` or `root_bash.sh`. The `PS1` will automatically be populated with current chosen php version. +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. ```shell # Enter as user devilbox (normal operation / development) -host> ./bash.sh +host> ./shell.sh devilbox@php-7.0.19 in /shared/httpd $ ``` ```shell # Enter as root user (do root stuff) -host> ./root_bash.sh +host> ./shell.sh +devilbox@php-7.0.19 in /shared/httpd $ sudo su - root@php-7.0.19 in /shared/httpd $ ``` diff --git a/bash/README.md b/bash/README.md new file mode 100644 index 000000000..e69de29bb diff --git a/bash/bashrc.sh-example b/bash/bashrc.sh-example new file mode 100644 index 000000000..755b3a527 --- /dev/null +++ b/bash/bashrc.sh-example @@ -0,0 +1,14 @@ +# Bashrc folder +# +# 1. This folder will be mounted to /etc/bashrc-devilbox.d +# 2. All files ending by *.sh will be sourced by bash automatically +# for the devilbox and root user. +# + + +# Add your custom vimrc and always load it with vim. +# Also make sure you add vimrc to this folder. +alias vim='vim -u /etc/bashrc-devilbox.d/vimrc + + + diff --git a/docker-compose.yml b/docker-compose.yml index af2ab115d..4e6bf1bd0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -185,6 +185,9 @@ services: # to load custom PHP modules - ${DEVILBOX_PATH}/mod/${PHP_SERVER}:/usr/lib64/php/custom-modules:ro + # Mount devilbox user-defined bash config + - ${DEVILBOX_PATH}/bash:/etc/bashrc-devilbox.d + # Mount custom mass virtual hosting # (configured in /etc/${HTTPD_SERVER}/02-vhost-mass.conf) - ${HOST_PATH_HTTPD_DATADIR}:/shared/httpd diff --git a/docs/Backups.md b/docs/Backups.md index df7556793..6c4b2693c 100644 --- a/docs/Backups.md +++ b/docs/Backups.md @@ -81,7 +81,7 @@ There are many different options to backup your MySQL database including some fo ```shell # Enter the Container -host> ./bash.sh +host> ./shell.sh # Start the backup devilbox@php-7.1.6 in /shared/httpd $ mysqldump-secure @@ -209,7 +209,7 @@ To find out more about the configuration and options of mysqldump-secure, visit ```shell # Enter the Container -host> ./bash.sh +host> ./shell.sh # Start the backup devilbox@php-7.1.6 in /shared/httpd $ mysqldump -h mysql -u root -p my_db_name > /shared/backups/mysql/my_db_name.sql @@ -239,7 +239,7 @@ In order to restore or import mysql databases on the command line, you need to u ```shell # Enter the Container -host> ./bash.sh +host> ./shell.sh # Start the import devilbox@php-7.1.6 in /shared/httpd $ mysql -h mysql -u root -p my_db_name < /shared/backups/mysql/my_db_name.sql @@ -249,7 +249,7 @@ devilbox@php-7.1.6 in /shared/httpd $ mysql -h mysql -u root -p my_db_name < /sh ```shell # Enter the Container -host> ./bash.sh +host> ./shell.sh # Start the import devilbox@php-7.1.6 in /shared/httpd $ zcat /shared/backups/mysql/my_db_name.sql.gz | mysql -h mysql -u root -p my_db_name @@ -259,7 +259,7 @@ devilbox@php-7.1.6 in /shared/httpd $ zcat /shared/backups/mysql/my_db_name.sql. ```shell # Enter the Container -host> ./bash.sh +host> ./shell.sh # Start the import devilbox@php-7.1.6 in /shared/httpd $ tar xzOf /shared/backups/mysql/my_db_name.sql.tar.gz | mysql -h mysql -u root -p my_db_name @@ -284,7 +284,7 @@ devilbox@php-7.1.6 in /shared/httpd $ tar xzOf /shared/backups/mysql/my_db_name. ```shell # Enter the Container -host> ./bash.sh +host> ./shell.sh # Start the import devilbox@php-7.1.6 in /shared/httpd $ pg_dump -h pgsql -U postgres -W my_db_name > /shared/backups/pgsql/my_db_name.sql @@ -308,7 +308,7 @@ In order to restore or import PostgreSQL databases on the command line, you need ```shell # Enter the Container -host> ./bash.sh +host> ./shell.sh # Start the import devilbox@php-7.1.6 in /shared/httpd $ psql -h pgsql -U postgres -W my_db_name < /shared/backups/pgsql/my_db_name.sql @@ -318,7 +318,7 @@ devilbox@php-7.1.6 in /shared/httpd $ psql -h pgsql -U postgres -W my_db_name < ```shell # Enter the Container -host> ./bash.sh +host> ./shell.sh # Start the import devilbox@php-7.1.6 in /shared/httpd $ zcat /shared/backups/pgsql/my_db_name.sql.gz | psql -h pgsql -U postgres -W my_db_name @@ -328,7 +328,7 @@ devilbox@php-7.1.6 in /shared/httpd $ zcat /shared/backups/pgsql/my_db_name.sql. ```shell # Enter the Container -host> ./bash.sh +host> ./shell.sh # Start the import devilbox@php-7.1.6 in /shared/httpd $ tar xzOf /shared/backups/pgsql/my_db_name.sql.tar.gz | psql -h pgsql -U postgres -W my_db_name @@ -349,7 +349,7 @@ devilbox@php-7.1.6 in /shared/httpd $ tar xzOf /shared/backups/pgsql/my_db_name. ```shell # Enter the Container -host> ./bash.sh +host> ./shell.sh # Start the dump into /shared/backups/mongo devilbox@php-7.1.6 in /shared/httpd $ mongodump --out /shared/backups/mongo @@ -365,7 +365,7 @@ To find out more about the configuration and options of mongodump, visit its pro ```shell # Enter the Container -host> ./bash.sh +host> ./shell.sh # Start the restore/import from /shared/backups/mongo devilbox@php-7.1.6 in /shared/httpd $ mongorestore /shared/backups/mongo diff --git a/docs/Examples.md b/docs/Examples.md index 4a3a94b87..0bd6a0c91 100644 --- a/docs/Examples.md +++ b/docs/Examples.md @@ -92,7 +92,7 @@ It will be ready in eight simple steps: ```shell # 1. Enter the PHP container -host> ./bash.sh +host> ./shell.sh # 2. Create a new VirtualHost directory devilbox@php-7.0.20 in /shared/httpd $ mkdir my-cake @@ -165,7 +165,7 @@ It will be ready in six simple steps: ```shell # 1. Enter the PHP container -host> ./bash.sh +host> ./shell.sh # 2. Create a new VirtualHost directory devilbox@php-7.0.20 in /shared/httpd $ mkdir my-drupal @@ -213,7 +213,7 @@ It will be ready in six simple steps: ```shell # 1. Enter the PHP container -host> ./bash.sh +host> ./shell.sh # 2. Create a new VirtualHost directory devilbox@php-7.0.20 in /shared/httpd $ mkdir my-laravel @@ -259,7 +259,7 @@ It will be ready in six simple steps: ```shell # 1. Enter the PHP container -host> ./bash.sh +host> ./shell.sh # 2. Create a new VirtualHost directory devilbox@php-7.0.20 in /shared/httpd $ mkdir my-phalcon @@ -306,7 +306,7 @@ It will be ready in six simple steps: ```shell # 1. Enter the PHP container -host> ./bash.sh +host> ./shell.sh # 2. Create a new VirtualHost directory devilbox@php-7.0.20 in /shared/httpd $ mkdir my-symfony @@ -356,7 +356,7 @@ It will be ready in six simple steps: ```shell # 1. Enter the PHP container -host> ./bash.sh +host> ./shell.sh # 2. Create a new VirtualHost directory devilbox@php-7.0.20 in /shared/httpd $ mkdir my-wp @@ -402,7 +402,7 @@ It will be ready in six simple steps: ```shell # 1. Enter the PHP container -host> ./bash.sh +host> ./shell.sh # 2. Create a new VirtualHost directory devilbox@php-7.0.20 in /shared/httpd $ mkdir my-yii @@ -448,7 +448,7 @@ It will be ready in six simple steps: ```shell # 1. Enter the PHP container -host> ./bash.sh +host> ./shell.sh # 2. Create a new VirtualHost directory devilbox@php-7.0.20 in /shared/httpd $ mkdir my-zend diff --git a/docs/Quickstart.md b/docs/Quickstart.md index 1a98012ba..d7a400b88 100644 --- a/docs/Quickstart.md +++ b/docs/Quickstart.md @@ -204,7 +204,7 @@ To quickly find setup instructions for your framework of choice head over to **[ The PHP Docker container is your workhorse which has many tools pre-installed and you can do every task inside instead of doing it on the docker host. Entering the container is done via a shipped script: ```shell -host> ./bash.sh +host> ./shell.sh devilbox@php-7.0.19 in /shared/httpd $ ``` diff --git a/docs/Usage.md b/docs/Usage.md index a8e80f897..93ead322b 100644 --- a/docs/Usage.md +++ b/docs/Usage.md @@ -100,10 +100,10 @@ The situation inside the container is not different from on the Docker host. All #### 3.1 As devilbox user -In the devilbox git directory you will find a bash script called `bash.sh`. Just execute this script and it will take you directly into the PHP docker container at the project root directory. +In the devilbox git directory you will find a bash script called `shell.sh`. Just execute this script and it will take you directly into the PHP docker container at the project root directory. ```shell -host> ./bash.sh +host> ./shell.sh devilbox@php-7.0.19 in /shared/httpd $ ``` @@ -111,10 +111,11 @@ As you can see, the PS1 prompt will also show you the current configured PHP ver #### 3.2 As root user -In case you need to perform some tasks that are only possible with root rights (such as installing or updating software), you can also use the `root_bash.sh` script. +In case you need to perform some tasks that are only possible with root rights (such as installing or updating software), you can do so via password-less `sudo`. ```shell -host> ./root_bash.sh +host> ./shell.sh +devilbox@php-7.0.19 in /shared/httpd $ sudo su - root@php-7.0.19 in /shared/httpd $ ``` diff --git a/root_bash.sh b/root_bash.sh deleted file mode 100755 index 7672f0cc6..000000000 --- a/root_bash.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -CWD="/shared/httpd" -docker-compose exec --user root php env TERM=xterm /bin/sh -c "cd ${CWD}; exec bash -l" diff --git a/bash.sh b/shell.sh similarity index 100% rename from bash.sh rename to shell.sh From 87b72199017e33706d1d9111ddd3b4995cfbc590 Mon Sep 17 00:00:00 2001 From: cytopia Date: Fri, 18 Aug 2017 09:14:33 +0200 Subject: [PATCH 11/11] DVL-012 Documentation: Customize bash and vim --- docs/Configure.md | 62 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 58 insertions(+), 4 deletions(-) diff --git a/docs/Configure.md b/docs/Configure.md index 1524523eb..61c45851a 100644 --- a/docs/Configure.md +++ b/docs/Configure.md @@ -23,8 +23,9 @@ Configure | 2. [The devilbox `cfg/` directory](#12-the-devilbox-cfg-directory) 3. [The devilbox `mod/` directory](#13-the-devilbox-mod-directory) 1. [Custom PHP module example](#134-custom-php-module-example) - 4. [The operating system `hosts` file](#14-the-operating-system-hosts-file) - 5. [The operating system `resolv.conf` file](#15-the-operating-system-resolvconf-file) + 4. [The devilbox `bash/` directory](#14-the-devilbox-bash-directory) + 5. [The operating system `hosts` file](#15-the-operating-system-hosts-file) + 6. [The operating system `resolv.conf` file](#16-the-operating-system-resolvconf-file) 2. [Devilbox general settings](#2-devilbox-general-settings) 1. [Verbosity](#21-verbosity) 2. [Devilbox base path](#22-devilbox-base-path) @@ -43,6 +44,7 @@ Configure | 3. [php.ini](#423-phpini) 4. [HHVM](#424-hhvm) 5. [Custom PHP modules](#425-custom-php-modules) + 6. [Customize bash and other tools](#426-customize-bash-and-other-tools) 3. [Apache / Nginx](#43-apache--nginx) 1. [Select Httpd version](#431-select-httpd-version) 2. [Host port](#432-host-port) @@ -176,13 +178,19 @@ zend_extension = /usr/lib64/php/custom-modules/ioncube_loader_lin_7.0.so **Note:** PHP configuration files are loaded by file names in alphabetical order and the ioncube zend extension needs to be loaded before any other zend extension. This is the reason why its configuration file name starts with `00-`. -#### 1.4 The operating system `hosts` file +#### 1.4 The devilbox `bash/` directory + +Inside the devilbox root directory you will find a folder called `bash/`. Every file inside this folder ending by `*.sh` will be source by your bash, allowing for a customized bash configuration. All files not ending by `*.sh` will be ignored and can be used to create config files for other programs. + +The `bash/` folder will be mounted into the PHP/HHVM container to `/etc/bashrc-devilbox.d/`. + +#### 1.5 The operating system `hosts` file On Linux and OSX your hosts file is located at `/etc/hosts` on Windows it will be at `C:\Windows\System32\drivers\etc`. Use this file to setup custom DNS entries if you are not using Auto-DNS. Read up on it below at `/etc/hosts` or `Auto-DNS` section. -#### 1.5 The operating system `resolv.conf` file +#### 1.6 The operating system `resolv.conf` file This file is used to add the devilbox DNS server for Auto-DNS. @@ -444,6 +452,52 @@ zend_extension = /usr/lib64/php/custom-modules/ioncube_loader_lin_7.0.so **Note:** PHP configuration files are loaded by file names in alphabetical order and the ioncube zend extension needs to be loaded before any other zend extension. This is the reason why its configuration file name starts with `00-`. +##### 4.2.6 Customize bash and other tools + +The devilbox supports to load custom configuration files for your Docker containers bash. Put any file ending by `*.sh` into the `bash/` folder and they will automatically be sourced by your container's bash. It is also possible to add any other configuration files into that folder and start your app with the appended configuration path. To better understand how that works, have a look at the paths: + +| Docker | bash host path | Path inside Docker container | +|---------|----------------------------|------------------------| +| PHP 5.4 | `bash/.sh` | `/etc/bashrc-devilbox.d/.sh` | +| PHP 5.5 | `bash/.sh` | `/etc/bashrc-devilbox.d/.sh` | +| PHP 5.6 | `bash/.sh` | `/etc/bashrc-devilbox.d/.sh` | +| PHP 7.0 | `bash/.sh` | `/etc/bashrc-devilbox.d/.sh` | +| PHP 7.1 | `bash/.sh` | `/etc/bashrc-devilbox.d/.sh` | +| PHP 7.2 | `bash/.sh` | `/etc/bashrc-devilbox.d/.sh` | +| HHVM | `bash/.sh` | `/etc/bashrc-devilbox.d/.sh` | + +So lets assume you also want to change your vim configuration and have vim always use that specific config file during startup. This is achieved by placing the vim config file into that directory and create a bash alias, that always starts vim with that config file: + +On your host system do the following: + +```shell +# Create your vim config in the devilbox bash directory `my-vimrc` +$ vim bash/my-vimrc +``` +```vim +" You vim +set encoding=utf-8 " The encoding displayed +set nocompatible " Use vim defaults instead of vi defaults +set autoread " Automatically reload file contents when changed from outside +set backspace=indent,eol,start " Allow backspacing over everything in insert mode +set hidden " Start new file with :e without having to save current +set history=50 " Remember commands entered in : +set undolevels=100 " Use many levels of undo +set shell=$SHELL " Set Shell +set more " to show pages using `more` in command outpouts +set title " show vim in terminal title +``` + +Now add a custom bash config and create an alias to always start vim with the above created config: +```shell +$ vim bash/my-bash.sh +``` +```shell +alias vim='vim -u /etc/bashrc-devilbox.d/my-vimrc' +``` + +The next time you open `vim` within the PHP/HHVM docker container, it will automatically source your `my-vimrc`. + #### 4.3 Apache / Nginx ##### 4.3.1 Select Httpd version