mirror of
https://github.com/cytopia/devilbox.git
synced 2025-03-14 16:26:41 +00:00
Merge 148657b11db33f5cf0314be5a8181ae6ab81f228 into b5256e2a2b07571faff842f2bee4796f9ce3365d
This commit is contained in:
commit
f74111f1fd
6
.gitignore
vendored
6
.gitignore
vendored
@ -39,12 +39,6 @@
|
||||
/cfg/php-fpm-7.1/*.ini
|
||||
/cfg/hhvm-latest/*.ini
|
||||
|
||||
# gh-pages
|
||||
docs/Gemfile
|
||||
docs/Gemfile.lock
|
||||
docs/_site/
|
||||
docs/view-page.sh
|
||||
|
||||
|
||||
######################################
|
||||
# GENERIC
|
||||
|
@ -340,8 +340,8 @@ devilbox_start() {
|
||||
done
|
||||
printf "\n"
|
||||
|
||||
# Wait another 30 sec for databases to come up
|
||||
wait_for 30 1
|
||||
# Wait another 60 sec for databases to come up
|
||||
wait_for 60 1
|
||||
echo
|
||||
|
||||
}
|
||||
@ -436,7 +436,7 @@ devilbox_test_url() {
|
||||
_pattern="${2}"
|
||||
_number="${3}"
|
||||
|
||||
_count="$( curl -q "${_url}" 2>/dev/null | grep -c "${_pattern}" || true )"
|
||||
_count="$( curl -q --retry 100 --retry-max-time 0 "${_url}" 2>/dev/null | grep -c "${_pattern}" || true )"
|
||||
|
||||
if [ "${_count}" != "${_number}" ]; then
|
||||
echo "[ERR]: Found ${_count}/${_number} of '${_pattern}'"
|
||||
|
@ -172,10 +172,10 @@ matrix:
|
||||
###
|
||||
before_install:
|
||||
# Get newer docker version
|
||||
- max=20; i=0; while [ $i -lt $max ]; do if sudo apt-get update; then break; else i=$((i+1)); fi done
|
||||
- max=20; i=0; while [ $i -lt $max ]; do if sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-engine; then break; else i=$((i+1)); fi done
|
||||
- max=100; i=0; while [ $i -lt $max ]; do if sudo apt-get update; then break; else i=$((i+1)); fi done
|
||||
- max=100; i=0; while [ $i -lt $max ]; do if sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-engine; then break; else i=$((i+1)); fi done
|
||||
# Get newer docker-compose version
|
||||
- curl -L https://github.com/docker/compose/releases/download/1.13.0/docker-compose-`uname -s`-`uname -m` > docker-compose
|
||||
- curl -L --retry 100 --retry-max-time 0 https://github.com/docker/compose/releases/download/1.13.0/docker-compose-`uname -s`-`uname -m` > docker-compose
|
||||
- chmod +x docker-compose
|
||||
- sudo mv -f docker-compose /usr/local/bin
|
||||
|
||||
|
37
docs/Backups.md
Normal file
37
docs/Backups.md
Normal file
@ -0,0 +1,37 @@
|
||||
# Devilbox Documentation
|
||||
|
||||
[Overview](README.md) |
|
||||
[Quickstart](Quickstart.md) |
|
||||
[Install](Install.md) |
|
||||
[Update](Update.md) |
|
||||
[Configure](Configure.md) |
|
||||
[Run](Run.md) |
|
||||
[Usage](Usage.md) |
|
||||
Backups |
|
||||
[Examples](Examples.md) |
|
||||
[Technical](Technical.md) |
|
||||
[Hacking](Hacking.md) |
|
||||
[FAQ](FAQ.md)
|
||||
|
||||
---
|
||||
|
||||
## Backups
|
||||
|
||||
1. [MySQL](#1-mysql)
|
||||
1. [MySQL Database Backup](#1-1-mysql-database-backup)
|
||||
2. [MySQL Database Restore](#1-2-mysql-database-restore)
|
||||
2. [PostgreSQL](#2-postgresql)
|
||||
1. [PostgreSQL Database Backup](#2-1-postgresql-database-backup)
|
||||
2. [PostgreSQL Database Restore](#2-1-postgresql-database-restore)
|
||||
|
||||
---
|
||||
|
||||
## 1. MySQL
|
||||
|
||||
#### 1.1 MySQL Database Backup
|
||||
#### 1.2 MySQL Database Restore
|
||||
|
||||
## 2. PostgreSQL
|
||||
|
||||
#### 2.1 PostgreSQL Database Backup
|
||||
#### 2.2 PostgreSQL Database Restore
|
@ -1 +0,0 @@
|
||||
devilbox.org
|
@ -1,114 +0,0 @@
|
||||
# Devilbox Documentation
|
||||
|
||||
[Home](https://github.com/cytopia/devilbox) |
|
||||
[Overview](README.md) |
|
||||
Configuration |
|
||||
[Usage](Usage.md) |
|
||||
[Updating](Updating.md) |
|
||||
[Info](Info.md) |
|
||||
[PHP Projects](PHP_Projects.md) |
|
||||
[Emails](Emails.md) |
|
||||
[Logs](Logs.md) |
|
||||
[Intranet](Intranet.md) |
|
||||
[FAQ](FAQ.md)
|
||||
|
||||
----
|
||||
|
||||
## Configuration
|
||||
|
||||
|
||||
### 1. The `.env` file
|
||||
|
||||
All docker-compose configuration is done inside the `.env` file which simply defines key-value variables parsed to `docker-compose.yml`.
|
||||
|
||||
First thing to do after cloning this repository is creating this file from the `env-example`.
|
||||
|
||||
```shell
|
||||
$ cp env-example .env
|
||||
```
|
||||
|
||||
The file itself is well commented and should explain itself. In case anything is unclear leave an issue at GitHub.
|
||||
|
||||
> [What is the `.env` file?](https://docs.docker.com/compose/env-file/)
|
||||
|
||||
|
||||
There are a few sections you should be aware off to better understand how it all works.
|
||||
|
||||
#### 1.1 Selecting service versions
|
||||
|
||||
Each service has a `<SERVICE_NAME>_SERVER` variable with a corresponding version. All existing versions are present in the file and commented out.
|
||||
|
||||
It is important to leave at least one version uncomment, otherwise the start-up will lead to errors. Use the following variable to control which version will be loaded:
|
||||
|
||||
* **`PHP_SERVER`**
|
||||
* **`HTTPD_SERVER`**
|
||||
* **`MYSQL_SERVER`**
|
||||
* **`PGSQL_SERVER`**
|
||||
* **`REDIS_SERVER`**
|
||||
* **`MEMCD_SERVER`**
|
||||
|
||||
#### 1.2 Data directories
|
||||
|
||||
There are a few pre-configured data directories to make storage persistent across container restarts:
|
||||
|
||||
* *`HOST_PATH_HTTPD_DATADIR`*
|
||||
* *`HOST_PATH_MYSQL_DATADIR`*
|
||||
* *`HOST_PATH_PGSQL_DATADIR`*
|
||||
|
||||
The values by default point to relative directories inside the devilbox repository. You can however also point them to different locations (relative or absolute)
|
||||
|
||||
MySQL and PgSQL data directories will also append their version as a subfolder to the data directories in order to prevent database file corruptions due to different versions and possible incompatabilities between them.
|
||||
|
||||
If you have a MySQL database on your host computer with the same version that your docker container is using, you can also interchangeably use the data dir with you host MySQL version and vice-versa.
|
||||
|
||||
### 2. The `cfg/` directory
|
||||
|
||||
Inside the devilbox root directory you will find a foder called `cfg/`. This will contain subdirectories in the form of `<SERVICE>-<VERSION>`.
|
||||
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.
|
||||
|
||||
The folder structure looks like this:
|
||||
```
|
||||
cfg/
|
||||
hhvm-latest/
|
||||
mariadb-10.0/
|
||||
mariadb-10.1/
|
||||
mariadb-10.2/
|
||||
mariadb-10.3/
|
||||
mariadb-5.5/
|
||||
mysql-5.5/
|
||||
mysql-5.6/
|
||||
mysql-5.7/
|
||||
mysql-8.0/
|
||||
php-fpm-5.4/
|
||||
php-fpm-5.5/
|
||||
php-fpm-5.6/
|
||||
php-fpm-7.0/
|
||||
php-fpm-7.1/
|
||||
```
|
||||
|
||||
Each of the folders will contain an example file in the following format:
|
||||
```
|
||||
devilbox-custom.<ext>-example
|
||||
```
|
||||
|
||||
Only files which have the correct file extensions will be read, all others such as `*.<ext>-example` will be ignored.
|
||||
|
||||
#### 2.1 Adding PHP options
|
||||
|
||||
|
||||
|
||||
|
||||
---
|
||||
|
||||
### Hints
|
||||
|
||||
**A. 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. At least one version per service must be defined.
|
||||
|
||||
**B. I don't want to start all container. How would I do this?**
|
||||
|
||||
Head over to the **[Usage](Usage.md)** section to get an in-depth explanation about how to start services selectively.
|
70
docs/Configure.md
Normal file
70
docs/Configure.md
Normal file
@ -0,0 +1,70 @@
|
||||
# Devilbox Documentation
|
||||
|
||||
[Overview](README.md) |
|
||||
[Quickstart](Quickstart.md) |
|
||||
[Install](Install.md) |
|
||||
[Update](Update.md) |
|
||||
Configure |
|
||||
[Run](Run.md) |
|
||||
[Usage](Usage.md) |
|
||||
[Backups](Backups.md) |
|
||||
[Examples](Examples.md) |
|
||||
[Technical](Technical.md) |
|
||||
[Hacking](Hacking.md) |
|
||||
[FAQ](FAQ.md)
|
||||
|
||||
---
|
||||
|
||||
## Configure
|
||||
|
||||
1. [Overview]()
|
||||
2. [Devilbox general settings](#1-devilbox-general-settings)
|
||||
1. [Verbosity]()
|
||||
2. [Devilbox base path]()
|
||||
3. [Host computer listening address]()
|
||||
3. [Project settings]()
|
||||
1. [Project domain]()
|
||||
2. [Project path]()
|
||||
4. [Container settings]()
|
||||
1. [General]()
|
||||
1. [Timezone]()
|
||||
2. [PHP / HHVM]()
|
||||
1. [User id]()
|
||||
2. [Group id]()
|
||||
3. [Xdebug]()
|
||||
4. [php.ini]()
|
||||
5. [HHVM]()
|
||||
3. [Webserver]()
|
||||
1. [Host port]()
|
||||
4. [MySQL]()
|
||||
1. [Root password]()
|
||||
2. [General Log]()
|
||||
3. [Host port]()
|
||||
4. [Data path]()
|
||||
5. [my.cnf]()
|
||||
5. [PostgreSQL]()
|
||||
1. [Root user]()
|
||||
2. [Root password]()
|
||||
3. [Host port]()
|
||||
4. [Data path]()
|
||||
6. [Redis]()
|
||||
1. [Host port]()
|
||||
7. [Memcached]()
|
||||
1. [Host port]()
|
||||
8. [MongoDB]()
|
||||
1. [Host port]()
|
||||
2. [Data path]()
|
||||
9. [Bind]()
|
||||
1. [Upstream resolver]()
|
||||
2. [Host port]()
|
||||
5. [Intranet settings]()
|
||||
1. [DNS check timeout]()
|
||||
6. [Host computer]()
|
||||
1. [DNS]()
|
||||
2. [/etc/hosts/]()
|
||||
|
||||
---
|
||||
|
||||
## 1. Overview
|
||||
|
||||
|
@ -1,23 +0,0 @@
|
||||
# Devilbox Documentation
|
||||
|
||||
[Home](https://github.com/cytopia/devilbox) |
|
||||
[Overview](README.md) |
|
||||
[Configuration](Configuration.md) |
|
||||
[Usage](Usage.md) |
|
||||
[Updating](Updating.md) |
|
||||
[Info](Info.md) |
|
||||
[PHP Projects](PHP_Projects.md) |
|
||||
Emails |
|
||||
[Logs](Logs.md) |
|
||||
[Intranet](Intranet.md) |
|
||||
[FAQ](FAQ.md)
|
||||
|
||||
----
|
||||
|
||||
## Emails
|
||||
|
||||
You can send emails from within your PHP projects without having to worry to accidentally sending them out.
|
||||
|
||||
All emails to whatever recipients are kept inside by a catch-all functionality from within the `php` container (using postfix).
|
||||
|
||||
In order to view the sent emails, use the bundled devilbox intranet and go to the Emails menu. For more information about this see the **[Intranet](Intranet.md)** section.
|
38
docs/Examples.md
Normal file
38
docs/Examples.md
Normal file
@ -0,0 +1,38 @@
|
||||
# Devilbox Documentation
|
||||
|
||||
[Overview](README.md) |
|
||||
[Quickstart](Quickstart.md) |
|
||||
[Install](Install.md) |
|
||||
[Update](Update.md) |
|
||||
[Configure](Configure.md) |
|
||||
[Run](Run.md) |
|
||||
[Usage](Usage.md) |
|
||||
[Backups](Backups.md) |
|
||||
Examples |
|
||||
[Technical](Technical.md) |
|
||||
[Hacking](Hacking.md) |
|
||||
[FAQ](FAQ.md)
|
||||
|
||||
---
|
||||
|
||||
## Examples
|
||||
|
||||
1. [Setup CakePHP](#1-setup-cakephp)
|
||||
2. [Setup Drupal](#2-setup-drupal)
|
||||
3. [Setup Symfony](#3-setup-symfony)
|
||||
4. [Setup Wordpress](#4-setup-wordpress)
|
||||
5. [Setup Yii](#5-setup-yii)
|
||||
|
||||
---
|
||||
|
||||
|
||||
## 1. Setup CakePHP
|
||||
|
||||
## 2. Setup Drupal
|
||||
|
||||
## 3. Setup Symfony
|
||||
|
||||
## 4. Setup Wordpress
|
||||
|
||||
## 5. Setup Yii
|
||||
|
60
docs/FAQ.md
60
docs/FAQ.md
@ -1,18 +1,19 @@
|
||||
# Devilbox Documentation
|
||||
|
||||
[Home](https://github.com/cytopia/devilbox) |
|
||||
[Overview](README.md) |
|
||||
[Configuration](Configuration.md) |
|
||||
[Quickstart](Quickstart.md) |
|
||||
[Install](Install.md) |
|
||||
[Update](Update.md) |
|
||||
[Configure](Configure.md) |
|
||||
[Run](Run.md) |
|
||||
[Usage](Usage.md) |
|
||||
[Updating](Updating.md) |
|
||||
[Info](Info.md) |
|
||||
[PHP Projects](PHP_Projects.md) |
|
||||
[Emails](Emails.md) |
|
||||
[Logs](Logs.md) |
|
||||
[Intranet](Intranet.md) |
|
||||
[Backups](Backups.md) |
|
||||
[Examples](Examples.md) |
|
||||
[Technical](Technical.md) |
|
||||
[Hacking](Hacking.md) |
|
||||
FAQ
|
||||
|
||||
----
|
||||
---
|
||||
|
||||
## FAQ
|
||||
|
||||
@ -35,3 +36,44 @@ See: *Why are mounted MySQL data directories separated by version?*
|
||||
**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?**
|
||||
|
||||
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?**
|
||||
|
||||
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?**
|
||||
|
||||
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*
|
||||
|
||||
There will however be slight differences between the versions and especially with HHVM. To see the exact bundled modules for each version visit the corresponding docker repositories on Github:
|
||||
|
||||
[PHP 5.4](https://github.com/cytopia/docker-php-fpm-5.4) |
|
||||
[PHP 5.5](https://github.com/cytopia/docker-php-fpm-5.5) |
|
||||
[PHP 5.6](https://github.com/cytopia/docker-php-fpm-5.6) |
|
||||
[PHP 7.0](https://github.com/cytopia/docker-php-fpm-7.0) |
|
||||
[PHP 7.1](https://github.com/cytopia/docker-php-fpm-7.1) |
|
||||
[HHVM](https://github.com/cytopia/docker-hhvm-latest)
|
||||
|
||||
|
||||
**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 informatino.
|
||||
|
||||
**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?**
|
||||
|
||||
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?**
|
||||
|
||||
Yes, this can be done by adding a \*.ini file to `./cfg/hhvm-latest/` with the following content: `hhvm.php7.all = 0` to disable PHP 7. The default is to use PHP 7 mode.
|
||||
|
158
docs/Hacking.md
Normal file
158
docs/Hacking.md
Normal file
@ -0,0 +1,158 @@
|
||||
# Devilbox Documentation
|
||||
|
||||
[Overview](README.md) |
|
||||
[Quickstart](Quickstart.md) |
|
||||
[Install](Install.md) |
|
||||
[Update](Update.md) |
|
||||
[Configure](Configure.md) |
|
||||
[Run](Run.md) |
|
||||
[Usage](Usage.md) |
|
||||
[Backups](Backups.md) |
|
||||
[Examples](Examples.md) |
|
||||
[Technical](Technical.md) |
|
||||
Hacking |
|
||||
[FAQ](FAQ.md)
|
||||
|
||||
---
|
||||
|
||||
## Hacking
|
||||
|
||||
1. [Rebuilding bundled Docker container](#1-rebuilding-bundled-docker-container)
|
||||
1. [Why rebuild yourself?](#1-1-why-rebuild-yourself-)
|
||||
2. [How to rebuild yourself?](#1-2-how-to-rebuild-yourself-)
|
||||
3. [How to use the rebuild container?](#1-3-how-to-use-the-rebuild-container-)
|
||||
2. [Customizing the bundled Docker container](#2-customizing-the-bundled-docker-container)
|
||||
3. [Adding your own Docker container](#3-adding-your-own-docker-container)
|
||||
1. [What information will you need?](#3-1-what-information-will-you-need-)
|
||||
2. [How to add your service?](#3-2-how-to-add-your-service-)
|
||||
3. [How to start your service?](#3-3-how-to-start-your-service-)
|
||||
|
||||
---
|
||||
|
||||
## 1. Rebuilding bundled Docker container
|
||||
|
||||
The devilbox Docker container are rebuild frequently and pushed to [dockerhub](https://hub.docker.com/r/cytopia/). However there might be cases in which you want to rebuild right away in order to use a new minor version of a tool inside the container.
|
||||
|
||||
#### 1.1 Why rebuild yourself?
|
||||
|
||||
Imagine for example you are using the [PHP 7.1](https://github.com/cytopia/docker-php-fpm-7.1) container which currently is available with the version 7.1.6. You found that PHP 7.1.7 has just been released, but the container wasn't yet updated to that version. If you can't wait and need that version now, you can just update the container to that version yourself.
|
||||
|
||||
#### 1.2 How to rebuild yourself?
|
||||
|
||||
Rebuilding yourself has been made pretty easy. The devilbox docker container repositories come with two scripts for automatic rebuilding. `build/docker-build.sh` and `build/docker-rebuild.sh`.
|
||||
|
||||
1. *Clone* or *fork and clone* the desired docker repository to your computer
|
||||
2. Run `build/docker-build.sh` (cached build) or `build/docker-rebuild.sh` (uncached build)
|
||||
|
||||
Either of the two above scripts will rebuild the desired docker container with the latest available versions. The rebuild docker container will then be available locally by the tag `latest`
|
||||
|
||||
#### 1.3 How to use the rebuild container?
|
||||
|
||||
##### 1.3.1 Tagged devilbox repository
|
||||
|
||||
If your devilbox git repository is checked out on a `git tag`, then also the docker container are bound to specific docker tags. It will look like this in `docker-compose.yml`:
|
||||
|
||||
```yml
|
||||
php:
|
||||
image: cytopia/${PHP_SERVER:-php-fpm-7.0}:0.10
|
||||
```
|
||||
|
||||
Your newly rebuild `latest` docker container will not yet be available for the next run. You still need to change the `docker-compose.yml` and set the container to `latest`:
|
||||
|
||||
```yml
|
||||
php:
|
||||
image: cytopia/${PHP_SERVER:-php-fpm-7.0}:latest
|
||||
```
|
||||
|
||||
##### 1.3.2 devilbox repository on master branch
|
||||
|
||||
If your devilbox git repository is checkout out on the `master` branch, then all docker container are always bound to the `latest` docker tag inside `docker-compose.yml` and you do not need to change anything. Just rebuilding the container is enough to be picked up for the next start.
|
||||
|
||||
|
||||
|
||||
## 2. Customizing the bundled Docker container
|
||||
|
||||
Customizing a Docker container is almost as simple as rebuilding it.
|
||||
|
||||
1. Fork the desired docker repository
|
||||
2. Clone your forked docker repository locally
|
||||
3. Edit `Dockerfile` with your customization
|
||||
4. Run `build/docker-build.sh` (cached build) or `build/docker-rebuild.sh` (uncached build)
|
||||
5. Read the rebuild section above to apply necessary steps
|
||||
|
||||
|
||||
## 3. Adding your own Docker container
|
||||
|
||||
You can add your custom docker container including its configuration to `docker-compose.yml`.
|
||||
|
||||
|
||||
#### 3.1 What information will you need?
|
||||
|
||||
1. A name that you can use to refer to in the docker-compose command
|
||||
2. The Docker image name
|
||||
3. The Docker image version or `latest`
|
||||
4. An unused IP address from the devilbox network
|
||||
|
||||
#### 3.2 How to add your service?
|
||||
|
||||
##### 3.2.1 General example
|
||||
|
||||
1. Open `docker-compose.yml`
|
||||
2. Paste the following snippet with your replaced values just below the `services:` line (with one level of indentation)
|
||||
|
||||
```yml
|
||||
...
|
||||
services:
|
||||
# Your custom Docker container here:
|
||||
<name>:
|
||||
image: <image-name>:<image-version>
|
||||
networks:
|
||||
app_net:
|
||||
ipv4_address: <unused-ip-address>
|
||||
# For ease of use always automatically start these:
|
||||
depends_on:
|
||||
- bind
|
||||
- php
|
||||
- httpd
|
||||
# End of custom Docker container
|
||||
...
|
||||
```
|
||||
|
||||
##### 3.2.2 Specific example
|
||||
|
||||
Lets make a real example for adding [Cockroach DB](https://hub.docker.com/r/cockroachdb/cockroach/)
|
||||
|
||||
1. Name: `cockroach`
|
||||
2. Image: `cockroachdb/cockroach`
|
||||
3. Version: `latest`
|
||||
4. IP: `172.16.238.200`
|
||||
|
||||
Now add the information to `docker-compose.yml` just below the `services:` line:
|
||||
|
||||
```yml
|
||||
...
|
||||
services:
|
||||
# Your custom Docker container here:
|
||||
cockroach:
|
||||
image: cockroachdb/cockroach:latest
|
||||
networks:
|
||||
app_net:
|
||||
ipv4_address: 172.16.238.200
|
||||
# For ease of use always automatically start these:
|
||||
depends_on:
|
||||
- bind
|
||||
- php
|
||||
- httpd
|
||||
# End of custom Docker container
|
||||
...
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### 3.3 How to start your service?
|
||||
|
||||
```shell
|
||||
# The following will bring up your service including all the
|
||||
# dependent services (bind, php and httpd)
|
||||
$ docker-compose up <name>
|
||||
```
|
73
docs/Info.md
73
docs/Info.md
@ -1,73 +0,0 @@
|
||||
# Devilbox Documentation
|
||||
|
||||
[Home](https://github.com/cytopia/devilbox) |
|
||||
[Overview](README.md) |
|
||||
[Configuration](Configuration.md) |
|
||||
[Usage](Usage.md) |
|
||||
[Updating](Updating.md) |
|
||||
Info |
|
||||
[PHP Projects](PHP_Projects.md) |
|
||||
[Emails](Emails.md) |
|
||||
[Logs](Logs.md) |
|
||||
[Intranet](Intranet.md) |
|
||||
[FAQ](FAQ.md)
|
||||
|
||||
----
|
||||
|
||||
## Info
|
||||
|
||||
|
||||
### Available containers
|
||||
|
||||
It is best to use the hostnames and not to rely on the ip addresses as they might change. In most cases however you can even use `127.0.0.1` or `localhost` (See background section below).
|
||||
|
||||
> E.g.: When you want to setup a MySQL database connection use `mysql` or `127.0.0.1` as the hostname.
|
||||
|
||||
| Container | Container name | Hostname | IP Address |
|
||||
|-----------------|-----------------|-----------|----------------|
|
||||
| DNS | bind | bind | 172.16.238.100 |
|
||||
| PHP / HHVM | php | php | 172.16.238.10 |
|
||||
| Apache / Nginx | http | http | 172.16.238.11 |
|
||||
| MySQL / MariaDB | mysql | mysql | 172.16.238.12 |
|
||||
| PostgreSQL | pgsql | pgsql | 172.16.238.13 |
|
||||
| Redis | redis | redis | 172.16.238.14 |
|
||||
| Memcached | memcd | memcd | 172.16.238.15 |
|
||||
| MongoDB | mongo | mongo | 172.16.238.16 |
|
||||
|
||||
### Background
|
||||
|
||||
#### Background - PHP Container
|
||||
|
||||
The `php` container is the center of all container. Everything happens in there.
|
||||
This is also the reason it does some more magic than actually required.
|
||||
|
||||
**Remote ports and remote sockets are made available to the `php` container.**
|
||||
|
||||
The PHP container is using [socat](https://linux.die.net/man/1/socat) to
|
||||
1. forward the remote mysql port `3306` (on the mysql container) to its own `127.0.0.1:3306`
|
||||
2. forward the remote pgsql port `5432` (on the pgsql container) to its own `127.0.0.1:5432`
|
||||
3. forward the remote redis port `6379` (on the redis container) to its own `127.0.0.1:6379`
|
||||
4. forward the remote memcached port `11211` (on the memcd container) to its own `127.0.0.1:11211`
|
||||
5. forward the remote mongodb port `27017` (on the mongo container) to its own `127.0.0.1:27017`
|
||||
|
||||
|
||||
#### Background - Docker Host
|
||||
|
||||
The docker host (your computer) does exactly the same as the `php` container.
|
||||
1. container mysql port `3306` is exposed to the host on port `127.0.0.1:3306`
|
||||
2. container pgsql port `5432` is exposed to the host on port `127.0.0.1:5432`
|
||||
3. container redis port `6379` is exposed to the host on port `127.0.0.1:6379`
|
||||
3. container memcd port `11211` is exposed to the host on port `127.0.0.1:11211`
|
||||
3. container mongo port `27017` is exposed to the host on port `127.0.0.1:27017`
|
||||
|
||||
Also the database sockets from the container are mounted into the host.
|
||||
|
||||
#### Background - Benefit of the above
|
||||
|
||||
With the PHP container and the docker host (your computer) behaving the same it is possible to write your php applications like this:
|
||||
```php
|
||||
<?php
|
||||
mysql_connect('127.0.0.1', 'user', 'pass');
|
||||
```
|
||||
|
||||
This setup can then either be served by the docker or by your host computer (if you shutdown docker and start your local lamp stack)
|
82
docs/Install.md
Normal file
82
docs/Install.md
Normal file
@ -0,0 +1,82 @@
|
||||
# Devilbox Documentation
|
||||
|
||||
[Overview](README.md) |
|
||||
[Quickstart](Quickstart.md) |
|
||||
Install |
|
||||
[Update](Update.md) |
|
||||
[Configure](Configure.md) |
|
||||
[Run](Run.md) |
|
||||
[Usage](Usage.md) |
|
||||
[Backups](Backups.md) |
|
||||
[Examples](Examples.md) |
|
||||
[Technical](Technical.md) |
|
||||
[Hacking](Hacking.md) |
|
||||
[FAQ](FAQ.md)
|
||||
|
||||
---
|
||||
|
||||
## Install
|
||||
|
||||
1. [Install Docker](#1-install-docker)
|
||||
1. [Linux](#1-1-linux)
|
||||
2. [Windows](#1-2-windows)
|
||||
3. [OSX](#1-3-osx)
|
||||
2. [Install Devilbox](#2-install-devilbox)
|
||||
1. [Latest git tag](#2-1-latest-git-tag)
|
||||
2. [Current master branch](#2-2-current-master-branch)
|
||||
|
||||
---
|
||||
|
||||
## 1. Install Docker
|
||||
|
||||
Only requirement for the devilbox is to have docker and docker-compose installed, everything else is bundled and provided within the Docker container.
|
||||
|
||||
#### 1.1 Linux
|
||||
|
||||
Refer to the official [Docker for Linux documentation](https://docs.docker.com/engine/installation/#supported-platforms) for how to install Docker on your distribution.
|
||||
|
||||
#### 1.2 Windows
|
||||
|
||||
Refer to the official [Docker for Windows documentation](https://docs.docker.com/docker-for-windows/install/) for how to install Docker.
|
||||
|
||||
**Note:** You should install the [Native Windows Docker](https://docs.docker.com/docker-for-windows/install/) and not the [Docker Toolbox](https://docs.docker.com/toolbox/overview/).
|
||||
|
||||
#### 1.3 OSX
|
||||
|
||||
Refer to the official [Docker for Mac documentation](https://docs.docker.com/docker-for-mac/install/) for how to install Docker.
|
||||
|
||||
**Note:** You should install the [Native Mac Docker](https://docs.docker.com/docker-for-mac/install/) and not the [Docker Toolbox](https://docs.docker.com/toolbox/overview/).
|
||||
|
||||
## 2. Install Devilbox
|
||||
|
||||
Just clone the devilbox repository and copy the configuration file.
|
||||
|
||||
```shell
|
||||
$ git clone https://github.com/cytopia/devilbox
|
||||
$ cd devilbox
|
||||
$ cp env-example .env
|
||||
```
|
||||
|
||||
You are all set now and can continue with [configuring the devilbox](Configure.md).
|
||||
|
||||
|
||||
#### 2.1 Latest git tag
|
||||
|
||||
If you always want a stable development environment, you should stay on the latest git tag. However devilbox git tags are tied to specific Docker container tags. That means you will only get new Docker versions once you switch to the next devilbox git tag.
|
||||
|
||||
To check out the latest git tag, issue the following command:
|
||||
|
||||
```shell
|
||||
$ git checkout "$(git describe --abbrev=0 --tags)"
|
||||
```
|
||||
|
||||
When updating git tags, you do not need to explicitly pull new Docker images, as this will be done automatically once starting up the devilbox. The only thing you will have to do is to compare your current configuration file `.env` with possible new options in `env-example`. Refer to [Update](Update.md) For more information about how to update the devilbox properly.
|
||||
|
||||
#### 2.2 Current master branch
|
||||
|
||||
The devilbox master branch will always reflect the latest changes. However, no commits are pushed directly to master and everything merged into this branch has to go through various tests to make sure the master branch stays as stable as it can get.
|
||||
The master branch ties each Docker container to their `latest` Docker tags. That means you can regularily `docker-compose pull` in order to obtain updated Docker container.
|
||||
|
||||
**Note:** Always do `git pull origin master` and `docker-compose pull` together. Do not just do one of them.
|
||||
|
||||
For the installation routine, there is nothing else to do here. After cloning you are automatically on the master branch. There are however a few things to pay attention to when updating the master branch. Refer to [Update](Update.md) For more information about how to update the devilbox properly.
|
@ -1,18 +0,0 @@
|
||||
# Devilbox Documentation
|
||||
|
||||
[Home](https://github.com/cytopia/devilbox) |
|
||||
[Overview](README.md) |
|
||||
[Configuration](Configuration.md) |
|
||||
[Usage](Usage.md) |
|
||||
[Updating](Updating.md) |
|
||||
[Info](Info.md) |
|
||||
[PHP Projects](PHP_Projects.md) |
|
||||
[Emails](Emails.md) |
|
||||
[Logs](Logs.md) |
|
||||
Intranet |
|
||||
[FAQ](FAQ.md)
|
||||
|
||||
----
|
||||
|
||||
## Intranet
|
||||
|
58
docs/Logs.md
58
docs/Logs.md
@ -1,58 +0,0 @@
|
||||
# Devilbox Documentation
|
||||
|
||||
[Home](https://github.com/cytopia/devilbox) |
|
||||
[Overview](README.md) |
|
||||
[Configuration](Configuration.md) |
|
||||
[Usage](Usage.md) |
|
||||
[Updating](Updating.md) |
|
||||
[Info](Info.md) |
|
||||
[PHP Projects](PHP_Projects.md) |
|
||||
[Emails](Emails.md) |
|
||||
Logs |
|
||||
[Intranet](Intranet.md) |
|
||||
[FAQ](FAQ.md)
|
||||
|
||||
----
|
||||
|
||||
## Logs
|
||||
|
||||
Log information is available in two forms.
|
||||
|
||||
1. Mounted log directories
|
||||
2. Docker logs
|
||||
|
||||
### Mounted log directories
|
||||
|
||||
Inside the devilbox directory you will find a folder `log/`.
|
||||
This itself will contain subdirectories in the form `<service>-<version>` which will then hold all available log files.
|
||||
|
||||
**Example:**
|
||||
|
||||
```
|
||||
devilbox/
|
||||
log/
|
||||
apache-2.2/
|
||||
access_log
|
||||
error_log
|
||||
localhost-access.log
|
||||
localhost-error.log
|
||||
other-error.log
|
||||
mariadb-10.3/
|
||||
error.log
|
||||
query.log
|
||||
slow.log
|
||||
php-fpm-7.0/
|
||||
php-fpm.err
|
||||
www-access.log
|
||||
www-error.log
|
||||
```
|
||||
|
||||
### Docker logs
|
||||
|
||||
All output that is produced to stdout or stderr by the started service will be available in `docker logs`. In order to view them constantly in a terminal session use:
|
||||
|
||||
```shell
|
||||
docker-compose logs -f
|
||||
```
|
||||
|
||||
Docker logs are currently only being used to display the initial startup including the chosen settings. All other logging is written to file and mounted to the docker host.
|
@ -1,120 +0,0 @@
|
||||
# Devilbox Documentation
|
||||
|
||||
[Home](https://github.com/cytopia/devilbox) |
|
||||
[Overview](README.md) |
|
||||
[Configuration](Configuration.md) |
|
||||
[Usage](Usage.md) |
|
||||
[Updating](Updating.md) |
|
||||
[Info](Info.md) |
|
||||
PHP Projects |
|
||||
[Emails](Emails.md) |
|
||||
[Logs](Logs.md) |
|
||||
[Intranet](Intranet.md) |
|
||||
[FAQ](FAQ.md)
|
||||
|
||||
----
|
||||
|
||||
## PHP Projects
|
||||
|
||||
|
||||
### TL;DR
|
||||
|
||||
1. Create folder `${HOST_PATH_HTTPD_DATADIR}/my-project/htdocs`
|
||||
2. Set `${TLD_SUFFIX}` in the `.env` file (example: `loc`)
|
||||
2. Expand docker host `/etc/hosts` with `127.0.0.1 my-project.loc` or attach included DNS server to your host and stop worrying about DNS
|
||||
3. Browse `http://my-project.loc`
|
||||
|
||||
|
||||
### Adding projects
|
||||
|
||||
As an example, we are going to add two projects.
|
||||
|
||||
**Prerequisites (dir)**
|
||||
|
||||
For this case let's assume your www root folder points to `~/www`. This means your projects will reside on your host computer in your home directory under www.
|
||||
|
||||
In order to achive this set `HOST_PATH_HTTPD_DATADIR=~/www` in the `.env` file (If this file does not yet exist, copy `env-example` to `.env`).
|
||||
|
||||
`.env`:
|
||||
```
|
||||
...
|
||||
HOST_PATH_HTTPD_DATADIR=~/www
|
||||
...
|
||||
```
|
||||
|
||||
**Prerequisites (domain suffix)**
|
||||
|
||||
Let's also assume that you have chosen `*.loc` as you projects `TLD_SUFFIX` Domain
|
||||
|
||||
In order to achive this set `TLD_SUFFIX=loc` in the `.env` file (If this file does not yet exist, copy `env-example` to `.env`).
|
||||
|
||||
`.env`:
|
||||
```
|
||||
...
|
||||
TLD_SUFFIX=loc
|
||||
...
|
||||
```
|
||||
|
||||
**Desired Projects**
|
||||
|
||||
| Project name | Document Root | URL |
|
||||
|--------------|---------------|-----|
|
||||
| devilbox | ~/www/devilbox/htdocs | http://devilbox.loc |
|
||||
| foo.bar | ~/www/foo.bar/htdocs | http://foo.bar.loc |
|
||||
|
||||
`htdocs` can either be a folder or a symlink to a folder.
|
||||
|
||||
**Project: devilbox**
|
||||
|
||||
Setup projects folder and an `index.php` (on your host computer)
|
||||
|
||||
```shell
|
||||
$ mkdir -p ~/www/devilbox/htdocs
|
||||
$ vim ~/devilbox/htdocs/index.php
|
||||
```
|
||||
|
||||
```php
|
||||
<?php
|
||||
echo 'hello world';
|
||||
?>
|
||||
```
|
||||
|
||||
Adjust your local (host computer) `/etc/hosts` and point `devilbox.loc` to your localhost address `127.0.0.1`
|
||||
|
||||
```shell
|
||||
$ sudo vim /etc/hosts
|
||||
```
|
||||
```shell
|
||||
127.0.0.1 devilbox.loc
|
||||
```
|
||||
|
||||
|
||||
**Project: foo.bar**
|
||||
|
||||
Setup projects folder and use existing github project to serve.
|
||||
|
||||
```shell
|
||||
$ mkdir -p ~/www/foo.bar
|
||||
$ cd ~/www/foo.bar
|
||||
|
||||
# Use an existing github project as your document root
|
||||
$ git clone https://github.com/<user>/<some-project>
|
||||
|
||||
# Symlink the project to htdocs
|
||||
$ ln -s <some-project> htdocs
|
||||
|
||||
$ ls -l
|
||||
drwxr-xr-x 4 cytopia 1286676289 136 Oct 30 14:24 <some-project>/
|
||||
lrwxr-xr-x 1 cytopia 1286676289 549 Nov 6 15:13 htdocs -> <some-project>/
|
||||
```
|
||||
|
||||
|
||||
Adjust your local (host computer) `/etc/hosts` and point `foo.bar.loc` to your localhost address `127.0.0.1`
|
||||
|
||||
```shell
|
||||
$ sudo vim /etc/hosts
|
||||
```
|
||||
```shell
|
||||
127.0.0.1 foo.bar.loc
|
||||
```
|
||||
|
130
docs/Quickstart.md
Normal file
130
docs/Quickstart.md
Normal file
@ -0,0 +1,130 @@
|
||||
# Devilbox Documentation
|
||||
|
||||
[Overview](README.md) |
|
||||
Quickstart |
|
||||
[Install](Install.md) |
|
||||
[Update](Update.md) |
|
||||
[Configure](Configure.md) |
|
||||
[Run](Run.md) |
|
||||
[Usage](Usage.md) |
|
||||
[Backups](Backups.md) |
|
||||
[Examples](Examples.md) |
|
||||
[Technical](Technical.md) |
|
||||
[Hacking](Hacking.md) |
|
||||
[FAQ](FAQ.md)
|
||||
|
||||
---
|
||||
|
||||
## Quickstart
|
||||
|
||||
1. [Installation](#1-installation)
|
||||
2. [Update](#2-update)
|
||||
1. [Tagged release](#2-1-tagged-release)
|
||||
2. [Master branch](#2-2-master-branch)
|
||||
3. [Configuration](#3-configuration)
|
||||
1. [.env](#3-1-env)
|
||||
2. [Services](#3-2-services)
|
||||
4. [Run](#4-run)
|
||||
1. [Run all](#4-1-run-all)
|
||||
2. [Run selection](#4-2-run-selection)
|
||||
5. [Project setup](#5-project-setup)
|
||||
|
||||
---
|
||||
|
||||
## 1. Installation
|
||||
|
||||
```shell
|
||||
$ git clone https://github.com/cytopia/devilbox
|
||||
$ cd devilbox/
|
||||
$ cp env-example .env
|
||||
```
|
||||
|
||||
## 2. Update
|
||||
|
||||
#### 2.1 Tagged release
|
||||
|
||||
```shell
|
||||
$ docker-compose stop
|
||||
$ git fetch --all
|
||||
$ git checkout "$(git describe --abbrev=0 --tags)"
|
||||
```
|
||||
|
||||
#### 2.2 Master branch
|
||||
|
||||
```shell
|
||||
$ 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)
|
||||
```shell
|
||||
$ vim .env
|
||||
```
|
||||
|
||||
#### 3.2 Services
|
||||
|
||||
Configure PHP 5.6
|
||||
```shell
|
||||
$ cd cfg/
|
||||
$ echo "max_execution_time = 180" > php-fpm-5.6/config.ini
|
||||
```
|
||||
|
||||
Configure MySQL 5.5
|
||||
```shell
|
||||
$ cd cfg/
|
||||
$ echo "[mysqld]\nslow_query_log = 1" > mysql-5.5/config.cnf
|
||||
```
|
||||
|
||||
## 4. Run
|
||||
|
||||
#### 4.1 Run all
|
||||
|
||||
```shell
|
||||
$ docker-compose up -d
|
||||
```
|
||||
|
||||
#### 4.2 Run selection
|
||||
|
||||
```shell
|
||||
$ 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 |
|
||||
|-----------------------|-----------------------------|------------------------|
|
||||
| <code>./data/www/<b>project1</b></code> | <code>./data/www/project1/<b>htdocs</b></code> | `http://project1.local` |
|
||||
| <code>./data/www/<b>project2</b></code> | <code>./data/www/project2/<b>htdocs</b></code> | `http://project2.local` |
|
||||
| <code>./data/www/<b>wordpress</b></code>| <code>./data/www/wordpress/<b>htdocs</b></code> | `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:
|
||||
|
||||
```shell
|
||||
$ ls -l
|
||||
drwxrwxr-x 2 cytopia 4096 Jun 14 08:29 cakephp
|
||||
lrwxrwxrwx 1 cytopia 11 Jun 14 08:29 htdocs -> cakephp/app/webroot/
|
||||
```
|
378
docs/README.md
378
docs/README.md
@ -1,292 +1,172 @@
|
||||
# Devilbox
|
||||
# Devilbox Documentation
|
||||
|
||||
| **Overview** | **Installing** | **Updating** | **Configuration** | **Usage** | **Technical** | **FAQ** |
|
||||
Overview |
|
||||
[Quickstart](Quickstart.md) |
|
||||
[Install](Install.md) |
|
||||
[Update](Update.md) |
|
||||
[Configure](Configure.md) |
|
||||
[Run](Run.md) |
|
||||
[Usage](Usage.md) |
|
||||
[Backups](Backups.md) |
|
||||
[Examples](Examples.md) |
|
||||
[Technical](Technical.md) |
|
||||
[Hacking](Hacking.md) |
|
||||
[FAQ](FAQ.md)
|
||||
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
### Dockerized LAMP/MEAN stack
|
||||
1. [Main idea](#1-main-idea)
|
||||
2. [Features](#2-features)
|
||||
3. [Supported Host OS](#3-supported-host-os)
|
||||
4. [Requirements](#4-requirements)
|
||||
5. [Docker documentation](#5-docker-documentation)
|
||||
6. [Devilbox documentation](#6-devilbox-documentation)
|
||||
7. [Video Tutorials](#7-video-tutorials)
|
||||
8. [Available PHP Modules](#8-available-php-modules)
|
||||
9. [Supported Frameworks and CMS](#9-supported-frameworks-and-cms)
|
||||
|
||||
<p class="center">The devilbox is a modern and highly customisable LAMP and MEAN stack replacement based purely on docker and docker-compose running on all major platforms. 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.</p>
|
||||
---
|
||||
|
||||
<img src="img/devilbox-dash.png" alt="Devilbox" style="max-width:100%"/>
|
||||
## 1. Main idea
|
||||
|
||||
The devilbox allows you to have an unlimitted number of projects ready without having to install any external software and without having to configure any virtual hosts. As well as providing a very flexible development stack that you can run offline. (Internet is only required to initially pull docker container).
|
||||
|
||||
### Supported Host OS
|
||||
The only thing you will have to do is to create a new folder on the filesystem and your virtual host is ready to be served with your custom domain.
|
||||
|
||||
<p class="center">Don't worry about switching computers. The devilbox will run on all major operating systems.</p>
|
||||
|
||||
<div class="center">
|
||||
<img class="battery" style="height:64px;" title="Linux support" alt="Linux support" src="https://raw.githubusercontent.com/cytopia/icons/master/64x64/linux.png" />
|
||||
<img class="battery" style="height:64px;" title="OSX support" alt="OSX support" src="https://raw.githubusercontent.com/cytopia/icons/master/64x64/osx.png" />
|
||||
<img class="battery" style="height:64px;" title="Windows support" alt="Windows support" src="https://raw.githubusercontent.com/cytopia/icons/master/64x64/windows.png" />
|
||||
</div>
|
||||
|
||||
|
||||
### Install, Configure and Start
|
||||
|
||||
<p class="center">Your whole development stack is up and running in a few simple steps.</p>
|
||||
The default project catch-all domain is `*.dev` (see [Configure](Configure.md) for how to change it). Let's view an example:
|
||||
|
||||
```shell
|
||||
# Get the soures
|
||||
$ git clone https://github.com/cytopia/devilbox
|
||||
$ cd devilbox
|
||||
|
||||
# Create and customize the config file
|
||||
$ cp env-example .env
|
||||
$ vim .env
|
||||
|
||||
# Start your daemons
|
||||
$ docker-compose up
|
||||
# Inside your main project folder
|
||||
$ ls -l
|
||||
drwxr-xr-x 3 cytopia 4096 Jun 10 13:10 my-drupal
|
||||
drwxr-xr-x 3 cytopia 4096 Jun 10 13:10 my-wordpress
|
||||
drwxr-xr-x 3 cytopia 4096 Jun 10 13:10 project1
|
||||
drwxr-xr-x 3 cytopia 4096 Jun 10 13:10 project2
|
||||
drwxr-xr-x 3 cytopia 4096 Jun 10 13:10 yii-test
|
||||
```
|
||||
|
||||
By having the above folders, the devilbox will automatically be able to serve the following vhosts:
|
||||
|
||||
### Run exactly what you need
|
||||
* http://my-drupal.dev
|
||||
* http://my-wordpress.dev
|
||||
* http://project1.dev
|
||||
* http://project2.dev
|
||||
* http://yii-test.dev
|
||||
|
||||
<p class="center">Choose your required daemons and select a version. Any combination is possible.<br/>This will allow you, to always exactly simulate your production environment locally during development.</p>
|
||||
New folders can be created, deleted and removed during run-time and corresponding virtual hosts will be available instantly without having to restart anything.
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Apache</th>
|
||||
<th>Nginx</th>
|
||||
<th>PHP</th>
|
||||
<th>MySQL</th>
|
||||
<th>MariaDB</th>
|
||||
<th>PgSQL</th>
|
||||
<th>Redis</th>
|
||||
<th>Memcached</th>
|
||||
<th>MongoDB</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><a target="_blank" title="Apache 2.2" href="https://github.com/cytopia/docker-apache-2.2">2.2</a></td>
|
||||
<td><a target="_blank" title="Nginx stable" href="https://github.com/cytopia/docker-nginx-stable">stable</a></td>
|
||||
<td><a target="_blank" title="PHP 5.4" href="https://github.com/cytopia/docker-php-fpm-5.4">5.4</a></td>
|
||||
<td><a target="_blank" title="MySQL 5.5" href="https://github.com/cytopia/docker-mysql-5.5">5.5</a></td>
|
||||
<td><a target="_blank" title="MariaDB 5.5" href="https://github.com/cytopia/docker-mariadb-5.5">5.5</a></td>
|
||||
<td><a target="_blank" title="PgSQL 9.1" href="https://github.com/docker-library/postgres">9.1</a></td>
|
||||
<td><a target="_blank" title="Redis 2.8" href="https://github.com/docker-library/redis">2.8</a></td>
|
||||
<td><a target="_blank" title="Memcached 1.4.21" href="https://github.com/docker-library/memcached">1.4.21</a></td>
|
||||
<td><a target="_blank" title="MongoDB 2.8" href="https://github.com/docker-library/mongo">2.8</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a target="_blank" title="Apache 2.4" href="https://github.com/cytopia/docker-apache-2.4">2.4</a></td>
|
||||
<td><a target="_blank" title="Nginx mainline" href="https://github.com/cytopia/docker-nginx-mainline">mainline</a></td>
|
||||
<td><a target="_blank" title="PHP 5.5" href="https://github.com/cytopia/docker-php-fpm-5.5">5.5</a></td>
|
||||
<td><a target="_blank" title="MySQL 5.6" href="https://github.com/cytopia/docker-mysql-5.6">5.6</a></td>
|
||||
<td><a target="_blank" title="MariaDB 10.0" href="https://github.com/cytopia/docker-mariadb-10.0">10.0</a></td>
|
||||
<td><a target="_blank" title="PgSQL 9.2" href="https://github.com/docker-library/postgres">9.2</a></td>
|
||||
<td><a target="_blank" title="Redis 3.0" href="https://github.com/docker-library/redis">3.0</a></td>
|
||||
<td><a target="_blank" title="Memcached 1.4.22" href="https://github.com/docker-library/memcached">1.4.22</a></td>
|
||||
<td><a target="_blank" title="MongoDB 3.0" href="https://github.com/docker-library/mongo">3.0</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><a target="_blank" title="PHP 5.6" href="https://github.com/cytopia/docker-php-fpm-5.6">5.6</a></td>
|
||||
<td><a target="_blank" title="MySQL 5.7" href="https://github.com/cytopia/docker-mysql-5.7">5.7</a></td>
|
||||
<td><a target="_blank" title="MariaDB 10.1" href="https://github.com/cytopia/docker-mariadb-10.1">10.1</a></td>
|
||||
<td><a target="_blank" title="PgSQL 9.3" href="https://github.com/docker-library/postgres">9.3</a></td>
|
||||
<td><a target="_blank" title="Redis 3.2" href="https://github.com/docker-library/redis">3.2</a></td>
|
||||
<td><a target="_blank" title="Memcached 1.4.23" href="https://github.com/docker-library/memcached">1.4.23</a></td>
|
||||
<td><a target="_blank" title="MongoDB 3.2" href="https://github.com/docker-library/mongo">3.2</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><a target="_blank" title="PHP 7.0" href="https://github.com/cytopia/docker-php-fpm-7.0">7.0</a></td>
|
||||
<td><a target="_blank" title="MySQL 8.0" href="https://github.com/cytopia/docker-mysql-8.0">8.0</a></td>
|
||||
<td><a target="_blank" title="MariaDB 10.2" href="https://github.com/cytopia/docker-mariadb-10.2">10.2</a></td>
|
||||
<td><a target="_blank" title="PgSQL 9.4" href="https://github.com/docker-library/postgres">9.4</a></td>
|
||||
<td></td>
|
||||
<td>...</td>
|
||||
<td><a target="_blank" title="MongoDB 3.4" href="https://github.com/docker-library/mongo">3.4</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><a target="_blank" title="PHP 7.1" href="https://github.com/cytopia/docker-php-fpm-7.1">7.1</a></td>
|
||||
<td></td>
|
||||
<td><a target="_blank" title="MariaDB 10.3" href="https://github.com/cytopia/docker-mariadb-10.3">10.3</a></td>
|
||||
<td><a target="_blank" title="PgSQL 9.5" href="https://github.com/docker-library/postgres">9.5</a></td>
|
||||
<td></td>
|
||||
<td><a target="_blank" title="Memcached 1.4.36" href="https://github.com/docker-library/memcached">1.4.36</a></td>
|
||||
<td><a target="_blank" title="MongoDB 3.5" href="https://github.com/docker-library/mongo">3.5</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><a target="_blank" title="HHVM" href="https://github.com/cytopia/docker-hhvm-latest">HHVM</a></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><a target="_blank" title="PgSQL 9.6" href="https://github.com/docker-library/postgres">9.6</a></td>
|
||||
<td></td>
|
||||
<td><a target="_blank" title="Memcached latest" href="https://github.com/docker-library/memcached">latest</a></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
## 2. Features
|
||||
|
||||
| Feature | Description |
|
||||
|---------|-------------|
|
||||
| **Internet** | |
|
||||
| No always-on | Internet connection is only required during initial setup or update (to pull containers), afterwards you can always work offline. |
|
||||
| **Projects** | |
|
||||
| Unlimitted Projects | Add as many Projects as you need. |
|
||||
| Auto VirtualHosts | New VirtualHosts are added instantly without a restart or reload. Just create a new directory and you are ready to go. |
|
||||
| Auto DNS | Use the built-in DNS server to stop worrying about `/etc/hosts` setup per project. |
|
||||
| Email catch-all | All outgoing emails are intercepted and stored locally. Use the intranet to view any sent email. |
|
||||
| Custom VirtualHost domains | Whatever project domain you desire: `*.dev`, `*.loc`, `*.local` or even subdomains like `*.sub.example` - you can adjust it to your needs. |
|
||||
| **Run** | |
|
||||
| Selective start | Run only the Docker container you actually need. |
|
||||
| Version choice | Use your development stack with whatever version combination needed. |
|
||||
| Stack choice | Attach SQL or NoSQL container and use Nginx or Apache to simulate your live env. |
|
||||
| Log files | Log files are available for each chosen version. |
|
||||
| **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. |
|
||||
| my.cnf | You an overwrite MySQL settings for each MySQL version. |
|
||||
| **Intranet** | |
|
||||
| phpMyAdmin | Manage your MySQL databases here. |
|
||||
| Adminer | Manage your SQL and NoSQL databases here. |
|
||||
| OpCacheGUI | Visualize the state of opcache usage. |
|
||||
| EmailGUI | See all sent emails at a glance |
|
||||
| **Docker Tools**|
|
||||
| Work inside container | You can completely work inside the PHP container and use all bundled tools in order to keep your host system clean. |
|
||||
| **Hacking** |
|
||||
| Add custom container | You can add any other Docker container to `docker-compose.yml` and start using them in your development stack. |
|
||||
|
||||
|
||||
### Run only what you need
|
||||
## 3. Supported Host OS
|
||||
|
||||
<p class="center">You are not forced to load the whole stack everytime. Only bring up what you really need.<br/>It is also possible to add or remove daemons while the stack is already running.</p>
|
||||
The devilbox runs on all major operating systems. Below you can quickly check the recommended docker versions and current issues per OS.
|
||||
|
||||
```shell
|
||||
# Load traditional lamp stack only
|
||||
$ docker-compose up httpd php mysql
|
||||
| | ![linux][lin-logo] | ![windows][win-logo] | ![osx][osx-logo] |
|
||||
|-------------|----------------------|---------------------------|----------------------|
|
||||
| **Docker Version** | normal | [Docker for Windows][d4w] | [Docker dor Mac][d4m]|
|
||||
| **Current Issues** | [here][lin-issues] | [here][win-issues] | [here][osx-issues] |
|
||||
|
||||
# Add redis to the running stack
|
||||
$ docker-compose up redis
|
||||
|
||||
# Stop MySQL from the current stack
|
||||
$ docker-compose stop mysql
|
||||
```
|
||||
[win-logo]: https://raw.githubusercontent.com/cytopia/icons/master/64x64/windows.png
|
||||
[lin-logo]: https://raw.githubusercontent.com/cytopia/icons/master/64x64/linux.png
|
||||
[osx-logo]: https://raw.githubusercontent.com/cytopia/icons/master/64x64/osx.png
|
||||
[d4w]: https://docs.docker.com/docker-for-windows/install/
|
||||
[d4m]: https://docs.docker.com/docker-for-mac/install/
|
||||
[dtb]: https://docs.docker.com/toolbox/overview/
|
||||
[win-issues]: https://github.com/cytopia/devilbox/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20label%3A%22host%3Awindows%22
|
||||
[lin-issues]: https://github.com/cytopia/devilbox/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20label%3A%22host%3Alinux%22
|
||||
[osx-issues]: https://github.com/cytopia/devilbox/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20label%3A%22host%3Aosx%22
|
||||
|
||||
|
||||
### Introduction Videos
|
||||
## 4. Requirements
|
||||
|
||||
<p class="center">Head over to youtube for a quick introduction and see for yourself how easily new projects can be created.</p>
|
||||
|
||||
<div class="center">
|
||||
<a target="_blank" href="https://www.youtube.com/watch?v=reyZMyt2Zzo" alt="Devilbox introduction video" title="Devilbox introduction video"><img src="img/devilbox_01-setup-and-workflow.png" /></a>
|
||||
<a target="_blank" href="https://www.youtube.com/watch?v=e-U-C5WhxGY" alt="Devilbox Email catch-all introduction" title="Devilbox Email catch-all introduction"><img src="img/devilbox_02-email-catch-all.png" /></a>
|
||||
</div>
|
||||
* **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)
|
||||
* 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])
|
||||
|
||||
|
||||
### PHP Modules
|
||||
## 5. Docker documentation
|
||||
|
||||
<div class="center">
|
||||
<p>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. There will however be slight differences between the versions and especially with HHVM. To see the exact bundled modules for each version visit the corresponding docker repositories on Github:</p>
|
||||
|
||||
<img class="battery" style="height:64px;" title="PHP" alt="PHP" src="img/logos/php.png" />
|
||||
<img class="battery" style="height:64px;" title="HHVM" alt="HHVM" src="img/logos/hhvm.png" />
|
||||
|
||||
<p>
|
||||
<strong><a target="_blank" title="PHP 5.4" href="https://github.com/cytopia/docker-php-fpm-5.4">PHP 5.4</a></strong> |
|
||||
<strong><a target="_blank" title="PHP 5.5" href="https://github.com/cytopia/docker-php-fpm-5.5">PHP 5.5</a></strong> |
|
||||
<strong><a target="_blank" title="PHP 5.6" href="https://github.com/cytopia/docker-php-fpm-5.5">PHP 5.6</a></strong> |
|
||||
<strong><a target="_blank" title="PHP 7.0" href="https://github.com/cytopia/docker-php-fpm-5.5">PHP 7.0</a></strong> |
|
||||
<strong><a target="_blank" title="PHP 7.1" href="https://github.com/cytopia/docker-php-fpm-5.5">PHP 7.1</a></strong> |
|
||||
<strong><a target="_blank" title="HHVM" href="https://github.com/cytopia/docker-hhvm-latest">HHVM</a></strong>
|
||||
</p>
|
||||
<p>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</p>
|
||||
</div>
|
||||
If you have never worked with docker/docker-compose before, you should check up on their documentation to get you started: [docker docs](https://docs.docker.com/).
|
||||
|
||||
|
||||
### Email catch-all
|
||||
## 6. Devilbox documentation
|
||||
|
||||
<div class="center">
|
||||
<img class="battery" style="height:64px;" title="Email catch-all" alt="Email catch-all" src="img/logos/email.png"/>
|
||||
<p>The built-in postfix mailserver is configured to automatically intercept all outgoing emails. This is an important measurement during development to make sure not to accidentally send out real emails. Instead you will be able to see all sent emails in the included intranet mail view. See Intranet section below.</p>
|
||||
</div>
|
||||
| Topic | Description |
|
||||
|-------------------------|-------------|
|
||||
| **Installing** | How to install docker, docker-compose and the devilbox |
|
||||
| **Updating** | Update best practise |
|
||||
| **Configuration** | How to configure the devilbox, switch versions (PHP, MySQL, PgSQL, ...) and how to set custom options (php.ini, my.cnf, httpd.conf, ...) |
|
||||
| **[Run](Run.md)** | How to operate the devilbox, start and stop all or only required Docker container. |
|
||||
| **[Usage](Usage.md)** | How to create projects, Email and DNS usage, tools (`composer`, `npm`, `node`, `drush`, ...), entering the container, Log files, Xdebug, Backups, Intranet, ...|
|
||||
| **[Examples](Examples.md)** | Some project examples for popular CMS/Frameworks. How to setup Wordpress, Drupal, Yii, ... |
|
||||
| **Technical** | Technical background information |
|
||||
| **[Hacking](Hacking.md)**| How to extend the devilbox with your own docker container |
|
||||
| **[FAQ](FAQ.md)** | Questions and Troubleshooting |
|
||||
|
||||
|
||||
### Auto-DNS
|
||||
## 7. Video Tutorials
|
||||
|
||||
<div class="center">
|
||||
<img class="battery" style="height:64px;" title="Auto-DNS" alt="Auto-DNS" src="img/logos/dns.png" />
|
||||
<p>Creating a new project just requires you to create a new folder on the filesystem. As you probalby don't want to bother with editing your /etc/hosts file everytime, the built-in DNS server will automatically provide the correct DNS records for every project.</p>
|
||||
</div>
|
||||
Have a look at youtube to see some the features in action.
|
||||
|
||||
[](https://www.youtube.com/watch?v=reyZMyt2Zzo)
|
||||
[](https://www.youtube.com/watch?v=e-U-C5WhxGY)
|
||||
|
||||
|
||||
### Batteries included
|
||||
## 8. Available PHP Modules
|
||||
|
||||
<p class="center">No need to download external tools. Everything is bundled, up-to-date and available inside the containers.</p>
|
||||
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.
|
||||
|
||||
<div class="center">
|
||||
<a target="_blank" title="phpMyAdmin" href="https://www.phpmyadmin.net"><img class="battery" style="height:64px;" src="img/logos/phpmyadmin.png" alt="Devilbox"/></a>
|
||||
<a target="_blank" title="Adminer" href="https://www.adminer.org"><img class="battery" style="height:64px;" src="img/logos/adminer.png" alt="Devilbox"/></a>
|
||||
<a target="_blank" title="OpCache GUI" href="https://github.com/amnuts/opcache-gui"><img class="battery" style="height:64px;" src="img/logos/opcachegui.png" alt="Devilbox"/></a>
|
||||
<br/>
|
||||
<a target="_blank" title="Composer" href="https://getcomposer.org"><img class="battery" style="height:64px;" src="img/logos/composer.png" alt="Devilbox"/></a>
|
||||
<a target="_blank" title="Drush" href="https://www.drupal.org/project/drush"><img class="battery" style="height:64px;" src="img/logos/drush.png" alt="Devilbox"/></a>
|
||||
<a target="_blank" title="Drupal Console" href="https://drupalconsole.com"><img class="battery" style="height:64px;" src="img/logos/drupal-console.png" alt="Devilbox"/></a>
|
||||
<a target="_blank" title="NodeJS" href="https://nodejs.org"><img class="battery" style="height:64px;" src="img/logos/nodejs.png" alt="Devilbox"/></a>
|
||||
<a target="_blank" title="WP-CLI" href="https://wp-cli.org"><img class="battery" style="height:64px;" src="img/logos/wp-cli.png" alt="Devilbox"/></a>
|
||||
<a target="_blank" title="NPM" href="https://www.npmjs.com"><img class="battery" style="height:64px;" src="img/logos/npm.png" alt="Devilbox"/></a>
|
||||
<a target="_blank" title="Git" href="https://git-scm.com"><img class="battery" style="height:64px;" src="img/logos/git.png" alt="Devilbox"/></a>
|
||||
</div>
|
||||
*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*
|
||||
|
||||
There will however be slight differences between the versions and especially with HHVM. To see the exact bundled modules for each version visit the corresponding docker repositories on Github:
|
||||
|
||||
### Supported Frameworks and CMS
|
||||
[PHP 5.4](https://github.com/cytopia/docker-php-fpm-5.4) |
|
||||
[PHP 5.5](https://github.com/cytopia/docker-php-fpm-5.5) |
|
||||
[PHP 5.6](https://github.com/cytopia/docker-php-fpm-5.6) |
|
||||
[PHP 7.0](https://github.com/cytopia/docker-php-fpm-7.0) |
|
||||
[PHP 7.1](https://github.com/cytopia/docker-php-fpm-7.1) |
|
||||
[HHVM](https://github.com/cytopia/docker-hhvm-latest)
|
||||
|
||||
<p class="center">There is nothing special about the devilbox, so any framework or CMS that will work with normal LAMP/MEAN stacks will work here as well. However in order to make double sure, a few popular applications have been explicitly tested.</p>
|
||||
|
||||
<div class="center">
|
||||
<a target="_blank" title="CakePHP" href="https://cakephp.org" ><img alt="CakePHP" class="battery" style="height:64px;" src="img/logos/cake.png" /></a>
|
||||
<a target="_blank" title="Drupal" href="https://www.drupal.org/" ><img alt="Drupal" class="battery" style="height:64px;" src="img/logos/drupal.png" /></a>
|
||||
<a target="_blank" title="PhalconPHP" href="https://phalconphp.com" ><img alt="PhalconPHP" class="battery" style="height:64px;" src="img/logos/phalcon.png" /></a>
|
||||
<a target="_blank" title="Wordpress" href="https://wordpress.org" ><img alt="Wordpress" class="battery" style="height:64px;" src="img/logos/wordpress.png" /></a>
|
||||
<a target="_blank" title="Yii" href="http://www.yiiframework.com" ><img alt="Yii" class="battery" style="height:64px;" src="img/logos/yii.png" /></a>
|
||||
</div>
|
||||
|
||||
|
||||
### Devilbox Intranet
|
||||
|
||||
<p class="center">Once the devilbox is up and running, you can visit the bundled intranet on <a target="_blank" href="http://localhost">http://localhost</a>.<br/>The intranet is not just a simple dash, it provides many useful tools:</p>
|
||||
|
||||
<div class="center">
|
||||
Container Health | DNS Status | Available vHosts | Emails | Databases | Effective Configuration<br/>
|
||||
<img alt="" title="" src="img/02_intranet_vhosts.png "/>
|
||||
<img alt="" title="" src="img/04_intranet_emails.png "/>
|
||||
</div>
|
||||
|
||||
|
||||
### Security
|
||||
|
||||
<p class="center">Be aware that the docker service is running with root privileges on your system (like any other webserver for example). The devilbox is using a mix of official docker images and custom images. All integrated containers are available on <a target="_blank" href="https://github.com/cytopia/devilbox#run-time-matrix">Github</a> and can be reviewed at any time.</p>
|
||||
|
||||
|
||||
### Up-to-dateness
|
||||
|
||||
<p class="center">Docker containers are pushed to <a target="_blank" href="https://hub.docker.com/r/cytopia">Docker Hub</a> frequently.<br/>It should be enough for you to pull updated images on a regeular basis.</p>
|
||||
|
||||
```shell
|
||||
$ docker-compose pull
|
||||
```
|
||||
|
||||
<p class="center">However, if a new minor version (PHP for example) has just been released and you want to use it right away, you can simply *git clone* the docker repository and rebuild the container. Each container repository contains a shell script for easy building.</p>
|
||||
|
||||
```shell
|
||||
# Download PHP 7.1 repository
|
||||
$ git clone https://github.com/cytopia/docker-php-fpm-7.1
|
||||
|
||||
# Rebuild the container in order to get the latest minor/patch version
|
||||
$ cd docker-php-fpm-7.1
|
||||
$ ./build/docker-rebuild.sh
|
||||
```
|
||||
|
||||
|
||||
### Integration Tests
|
||||
|
||||
<div class="center">
|
||||
<a target="_blank" href="https://travis-ci.org/cytopia/devilbox"><img src="https://travis-ci.org/cytopia/devilbox.svg?branch=master" /></a>
|
||||
</div>
|
||||
|
||||
<p class="center">In order to make sure everything always runs stable and as expected, the devilbox makes heavy use of integration tests. You can head over to <a target="_blank" href="https://travis-ci.org/cytopia/devilbox">Travis-CI</a> and have a look at stable and nightly builds.</p>
|
||||
|
||||
|
||||
### Contribute
|
||||
|
||||
<div class="center">
|
||||
<p>Contributers are welcome in any way.</p>
|
||||
|
||||
<p>First of all, if you like the project, please <a href="https://github.com/cytopia/devilbox">do star it</a>. 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.</p>
|
||||
|
||||
<p>You can also get actively involved. <a href="https://github.com/cytopia/devilbox">Do clone the project</a> and start improving whatever you think is useful. There is quite a lot todo and planned. If you like to contribute, view <a href="https://github.com/cytopia/devilbox/blob/master/CONTRIBUTING.md">CONTRIBUTING.md</a> and <a href="https://github.com/cytopia/devilbox/issues/23">ROADMAP</a>.</p>
|
||||
|
||||
<p>Major contributors will be credited within the intranet and on the github page.</p>
|
||||
</div>
|
||||
|
||||
|
||||
### License
|
||||
|
||||
<div class="center">
|
||||
<p>MIT License</p>
|
||||
<p>Copyright (c) 2016 cytopia</p>
|
||||
</div>
|
||||
## 9. Supported Frameworks and CMS
|
||||
|
||||
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:
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
182
docs/Run.md
Normal file
182
docs/Run.md
Normal file
@ -0,0 +1,182 @@
|
||||
# Devilbox Documentation
|
||||
|
||||
[Overview](README.md) |
|
||||
[Quickstart](Quickstart.md) |
|
||||
[Install](Install.md) |
|
||||
[Update](Update.md) |
|
||||
[Configure](Configure.md) |
|
||||
Run |
|
||||
[Usage](Usage.md) |
|
||||
[Backups](Backups.md) |
|
||||
[Examples](Examples.md) |
|
||||
[Technical](Technical.md) |
|
||||
[Hacking](Hacking.md) |
|
||||
[FAQ](FAQ.md)
|
||||
|
||||
---
|
||||
|
||||
## Run
|
||||
|
||||
1. [Start the devilbox](#1-start-the-devilbox)
|
||||
1. [Foreground Start](#1-1-foreground-start)
|
||||
2. [Background Start](#1-2-background-start)
|
||||
3. [Selective Start](#1-3-selective-start)
|
||||
2. [Stop the devilbox](#2-stop-the-devilbox)
|
||||
1. [Foreground Stop](#2-1-foreground-stop)
|
||||
2. [Background Stop](#2-2-background-stop)
|
||||
3. [Attach/Detach during run-time](#3-attach-detach-during-run-time)
|
||||
1. [Attach during run-time](#3-1-attach-during-run-time)
|
||||
2. [Detach during run-time](#3-2-detach-during-run-time)
|
||||
4. [Docker logs](#4-docker-logs)
|
||||
1. [All logs](#4-1-all-logs)
|
||||
1. [Specific logs](#4-2-specific-logs)
|
||||
1. [Tail logs](#4-3-tail-logs)
|
||||
|
||||
|
||||
---
|
||||
|
||||
## 1. Start the devilbox
|
||||
|
||||
Starting and stopping containers is done via docker-compose. If you have never worked with it before, have a look at their documentation for an [overview](https://docs.docker.com/compose/reference/overview/), [up](https://docs.docker.com/compose/reference/up/) and [stop](https://docs.docker.com/compose/reference/stop/) commands.
|
||||
|
||||
By starting up the devilbox all attached containers will send their stdout and stderr to docker logs (foreground or background), you can increase/decrease the containers startup verbosity by configuring the `.env` file. See [Configure](Configure.md) for how to change that behavior.
|
||||
|
||||
#### 1.1 Foreground Start
|
||||
|
||||
The normal start will bring up **all** container defined in *docker-compose.yml* and will stay in forground making it possible to stop them via Ctrl+c.
|
||||
|
||||
```shell
|
||||
$ docker-compose up
|
||||
```
|
||||
|
||||
#### 1.2 Background Start
|
||||
|
||||
Instead of having the docker-compose run stay in foreground, you can also send it to the background by adding `-d` as an argument. The following will bring up **all** container and send docker-compose to background.
|
||||
|
||||
```shell
|
||||
$ docker-compose up -d
|
||||
```
|
||||
|
||||
#### 1.3 Selective Start
|
||||
|
||||
There is no need to always bring up **all** container, if you just need a few at the moment. In order to do so, simply specify the container by name that you actually need.
|
||||
|
||||
##### 1.3.1 Starting httpd, php, bind and mysql
|
||||
|
||||
```shell
|
||||
# Foreground
|
||||
$ docker-compose up httpd php bind mysql
|
||||
|
||||
# Background
|
||||
$ docker-compose up -d httpd php bind mysql
|
||||
```
|
||||
|
||||
**Start Note:** `httpd`, `php` and `bind` are base container that will **always** be started if specified or not. (Defined by `depends_on` in `docker-compose.yml`). So the above could also be achieved by simply specifying `mysql` only.
|
||||
|
||||
```shell
|
||||
# Foreground
|
||||
$ docker-compose up mysql
|
||||
|
||||
# Background
|
||||
$ docker-compose up -d mysql
|
||||
```
|
||||
|
||||
**Log Note:** When you do not specify httpd, php and bind in foreground start, their docker-logs will not be shown and you will have to explicitly use `docker-compose logs` to view their stdout/stderr output. Refer to the Log section below.
|
||||
|
||||
##### 1.3.2 Starting httpd, php, bind, pgsql and redis
|
||||
|
||||
```shell
|
||||
# Foreground
|
||||
$ docker-compose up httpd php bind pgsql redis
|
||||
|
||||
# Background
|
||||
$ docker-compose up -d httpd php bind pgsql redis
|
||||
```
|
||||
|
||||
**Start Note:** `httpd`, `php` and `bind` are base container that will **always** be started if specified or not. (Defined by `depends_on` in `docker-compose.yml`). So the above could also be achieved by simply specifying `pgsql` and `redis` only.
|
||||
|
||||
```shell
|
||||
# Foreground
|
||||
$ docker-compose up pgsql redis
|
||||
|
||||
# Background
|
||||
$ docker-compose up -d pgsql redis
|
||||
```
|
||||
**Log Note:** When you do not specify httpd, php and bind in foreground start, their docker-logs will not be shown and you will have to explicitly use `docker-compose logs` to view their stdout/stderr output. Refer to the Log section below.
|
||||
|
||||
|
||||
## 2. Stop the devilbox
|
||||
|
||||
#### 2.1 Foreground stop
|
||||
|
||||
If you started up docker compose in foreground mode (without `-d`), you can hit `ctrl+c` to gracefull stop or **twice** `ctrl+c` to kill the running containers.
|
||||
|
||||
**Note:** Automatically started containers that were not specified (such as `http` or `php`) will have to be stopped manually via `docker-compose down` afterwards.
|
||||
|
||||
#### 2.2 Background stop
|
||||
|
||||
If you started up docker compose in background mode (with `-d`), go back to the devilbox directory (where the `docker-compose.yml` file resides and type `docker-compose down` to gracefully stop or `docker-compose kill` to kill them immediately.
|
||||
|
||||
```shell
|
||||
# Gracefully shutdown everything
|
||||
$ docker-compose down
|
||||
|
||||
# Kill everything immediately
|
||||
$ docker-compose kill
|
||||
```
|
||||
|
||||
Best pracice would be to start the container in the background (with `-d`) and use `docker compose down` to gracefully stop all of them.
|
||||
|
||||
## 3. Attach/Detach during run-time
|
||||
|
||||
#### 3.1 Attach during run-time
|
||||
|
||||
You can also add/attach containers during runtime if you need them. You might have started httpd, php, bind and mysql and decided that you will also require redis. So go ahead and add redis to the running container stack.
|
||||
|
||||
```shell
|
||||
# Foreground
|
||||
$ docker-compose up redis
|
||||
|
||||
# Background
|
||||
$ docker-compose up -d redis
|
||||
```
|
||||
|
||||
It is recommended to always use background starts, this way you can intially start your desired stack and re-use the current terminal window to start or stop other services.
|
||||
|
||||
|
||||
#### 3.2 Detach during run-time
|
||||
|
||||
You can also stop specific containers during runtime if they are not needed anymore. You might have started httpd, php, bind, mysql and redis and decided that redis was not needed. So go ahead and remove redis from the running container stack.
|
||||
|
||||
```shell
|
||||
$ docker-compose stop redis
|
||||
```
|
||||
|
||||
## 4. Docker Logs
|
||||
|
||||
Services started in background mode (`-d`) or those that were started as dependencies (`http` and `php`) will always only log to docker logs and not to stdout/stderr.
|
||||
|
||||
#### 4.1 All logs
|
||||
|
||||
In order to view logs of all started containers type:
|
||||
|
||||
```shell
|
||||
$ docker-compose logs
|
||||
```
|
||||
|
||||
#### 4.2 Specific logs
|
||||
|
||||
In order to view logs of a specific container, name it explicitly:
|
||||
|
||||
```shell
|
||||
$ docker-compose logs redis
|
||||
```
|
||||
|
||||
#### 4.3 Tail logs
|
||||
|
||||
There is also a version similar to `tail -f` to keep logs updated all the time.
|
||||
|
||||
```shell
|
||||
$ docker-compose logs -f
|
||||
```
|
||||
|
106
docs/Technical.md
Normal file
106
docs/Technical.md
Normal file
@ -0,0 +1,106 @@
|
||||
# Devilbox Documentation
|
||||
|
||||
[Overview](README.md) |
|
||||
[Quickstart](Quickstart.md) |
|
||||
[Install](Install.md) |
|
||||
[Update](Update.md) |
|
||||
[Configure](Configure.md) |
|
||||
[Run](Run.md) |
|
||||
[Usage](Usage.md) |
|
||||
[Backups](Backups.md) |
|
||||
[Examples](Examples.md) |
|
||||
Technical |
|
||||
[Hacking](Hacking.md) |
|
||||
[FAQ](FAQ.md)
|
||||
|
||||
---
|
||||
|
||||
## Technical
|
||||
|
||||
1. [Networking](#1-networking)
|
||||
2. [Ports and forwarding](#2-ports-and-forwarding)
|
||||
1. [PHP Container](#2-1-php-container)
|
||||
2. [Docker Host](#2-2-docker-host)
|
||||
3. [Works the same on Host and PHP Container](#3-works-the-same-on-host-and-php-container)
|
||||
|
||||
---
|
||||
|
||||
## 1. Networking
|
||||
|
||||
It is best to use the hostnames and not to rely on the ip addresses as they might change. In most cases however you can use `127.0.0.1` for all connections. Read up to find out why.
|
||||
|
||||
> E.g.: When you want to setup a MySQL database connection use `mysql` or `127.0.0.1` as the hostname.
|
||||
|
||||
| Container | Container name | Hostname | IP Address |
|
||||
|-----------------|-----------------|-----------|----------------|
|
||||
| DNS | bind | bind | 172.16.238.100 |
|
||||
| PHP / HHVM | php | php | 172.16.238.10 |
|
||||
| Apache / Nginx | http | http | 172.16.238.11 |
|
||||
| MySQL / MariaDB | mysql | mysql | 172.16.238.12 |
|
||||
| PostgreSQL | pgsql | pgsql | 172.16.238.13 |
|
||||
| Redis | redis | redis | 172.16.238.14 |
|
||||
| Memcached | memcd | memcd | 172.16.238.15 |
|
||||
| MongoDB | mongo | mongo | 172.16.238.16 |
|
||||
|
||||
## 2. Ports and forwarding
|
||||
|
||||
#### 2.1 PHP Container
|
||||
|
||||
The `php` container is the center of all container. Everything happens in there.
|
||||
This is also the reason it does some more magic than actually required.
|
||||
|
||||
**Remote ports and remote sockets are made available to the `php` container.**
|
||||
|
||||
The PHP container is using [socat](https://linux.die.net/man/1/socat) to
|
||||
|
||||
1. forward the remote mysql port `3306` (on the mysql container) to its own `127.0.0.1:3306`
|
||||
2. forward the remote pgsql port `5432` (on the pgsql container) to its own `127.0.0.1:5432`
|
||||
3. forward the remote redis port `6379` (on the redis container) to its own `127.0.0.1:6379`
|
||||
4. forward the remote memcached port `11211` (on the memcd container) to its own `127.0.0.1:11211`
|
||||
5. forward the remote mongodb port `27017` (on the mongo container) to its own `127.0.0.1:27017`
|
||||
|
||||
The following container can be reached from within the PHP container via the following methods:
|
||||
|
||||
| Container | Hostname | IP Address | IP Address | Port |
|
||||
|-----------------|-----------|----------------|------------|-------|
|
||||
| DNS | bind | 172.16.238.100 | - | 53 |
|
||||
| PHP / HHVM | php | 172.16.238.10 | - | 9000 |
|
||||
| Apache / Nginx | http | 172.16.238.11 | - | 80 |
|
||||
| MySQL / MariaDB | mysql | 172.16.238.12 | 127.0.0.1 | 3306 |
|
||||
| PostgreSQL | pgsql | 172.16.238.13 | 127.0.0.1 | 5432 |
|
||||
| Redis | redis | 172.16.238.14 | 127.0.0.1 | 6379 |
|
||||
| Memcached | memcd | 172.16.238.15 | 127.0.0.1 | 11211 |
|
||||
| MongoDB | mongo | 172.16.238.16 | 127.0.0.1 | 27017 |
|
||||
|
||||
|
||||
#### 2.2 Docker Host
|
||||
|
||||
The docker host (your computer) does exactly the same as the `php` container.
|
||||
|
||||
1. container mysql port `3306` is exposed to the host on port `127.0.0.1:3306`
|
||||
2. container pgsql port `5432` is exposed to the host on port `127.0.0.1:5432`
|
||||
3. container redis port `6379` is exposed to the host on port `127.0.0.1:6379`
|
||||
3. container memcd port `11211` is exposed to the host on port `127.0.0.1:11211`
|
||||
3. container mongo port `27017` is exposed to the host on port `127.0.0.1:27017`
|
||||
|
||||
The following container can be reached from the Docker host via the following methods:
|
||||
|
||||
| Container | IP Address | Port |
|
||||
|-----------------|------------|-------|
|
||||
| DNS | 127.0.0.1 | 53 |
|
||||
| PHP / HHVM | - | 9000 |
|
||||
| Apache / Nginx | 127.0.0.1 | 80 |
|
||||
| MySQL / MariaDB | 127.0.0.1 | 3306 |
|
||||
| PostgreSQL | 127.0.0.1 | 5432 |
|
||||
| Redis | 127.0.0.1 | 6379 |
|
||||
| Memcached | 127.0.0.1 | 11211 |
|
||||
| MongoDB | 127.0.0.1 | 27017 |
|
||||
|
||||
## 3. Works the same on Host and PHP Container
|
||||
|
||||
As you might have noticed, the ports and addresses will be exactly the same inside the PHP container and on the docker host (when using `127.0.0.1`) for most container. That way it is possible to write your php application like this:
|
||||
|
||||
```php
|
||||
<?php
|
||||
mysql_connect('127.0.0.1', 'user', 'pass');
|
||||
```
|
152
docs/Update.md
Normal file
152
docs/Update.md
Normal file
@ -0,0 +1,152 @@
|
||||
# Devilbox Documentation
|
||||
|
||||
[Overview](README.md) |
|
||||
[Quickstart](Quickstart.md) |
|
||||
[Install](Install.md) |
|
||||
Update |
|
||||
[Configure](Configure.md) |
|
||||
[Run](Run.md) |
|
||||
[Usage](Usage.md) |
|
||||
[Backups](Backups.md) |
|
||||
[Examples](Examples.md) |
|
||||
[Technical](Technical.md) |
|
||||
[Hacking](Hacking.md) |
|
||||
[FAQ](FAQ.md)
|
||||
|
||||
---
|
||||
|
||||
## Update
|
||||
|
||||
1. [TL;DR](#1-tl-dr)
|
||||
2. [Git tag vs master branch](#2-git-tag-vs-master-branch)
|
||||
1. [Git tag](#2-1-git-tag)
|
||||
2. [Git master branch](#2-2-git-master-branch)
|
||||
3. [Compare .env file](#3-compare-env-file)
|
||||
4. [Pull new Docker container (Important!)](#4-pull-new-docker-container-important-)
|
||||
|
||||
---
|
||||
|
||||
## 1. TL;DR
|
||||
|
||||
Shutdown, update and startup.
|
||||
|
||||
```shell
|
||||
# Stop container and update git
|
||||
$ docker-compose down
|
||||
$ git fetch --all
|
||||
$ git pull origin master
|
||||
|
||||
# Check for changes
|
||||
$ vimdiff .env env-example
|
||||
|
||||
# Pull all available container
|
||||
$ ./update-docker.sh
|
||||
# Or just pull currently enabled versions in .env
|
||||
$ docker-compose pull
|
||||
|
||||
# Ready and run
|
||||
$ docker-compose up
|
||||
```
|
||||
|
||||
Do not forget to read: [Pull new Docker container (Important!)](#4-pull-new-docker-container-important-)
|
||||
|
||||
## 2. Git tag vs master branch
|
||||
|
||||
#### 2.1 Git tag
|
||||
|
||||
Git tags tie each Docker container to a stable Docker tag. This will look like this in the `docker-compose.yml`
|
||||
|
||||
```shell
|
||||
$ grep '^[[:space:]]*image:' docker-compose.yml
|
||||
|
||||
image: cytopia/bind:0.9
|
||||
image: cytopia/${PHP_SERVER:-php-fpm-7.0}:0.9
|
||||
image: cytopia/${HTTPD_SERVER:-nginx-stable}:0.9
|
||||
image: cytopia/${MYSQL_SERVER:-mariadb-10.1}:0.9
|
||||
```
|
||||
|
||||
That means within your current git tag, you will not receive any Docker container updates, because the devilbox is bound to specific Docker tagged versions.
|
||||
|
||||
When a new devilbox tag is released, the `docker-compose.yml` file will have new Docker tags. There is no manuall action required. If you start up the devilbox for the first time, it will see that the container with those tags are not available locally and automatically start downloading them.
|
||||
|
||||
So the update procedure is as follows:
|
||||
|
||||
```shell
|
||||
$ git fetch --all
|
||||
$ git checkout "$(git describe --abbrev=0 --tags)"
|
||||
```
|
||||
|
||||
|
||||
**Note:** If you want to pre-download all available versions for later offline-usage, run the `update-docker.sh` script.
|
||||
|
||||
```shell
|
||||
$ ./update-docker.sh
|
||||
```
|
||||
|
||||
#### 2.2 Git master branch
|
||||
|
||||
The git master branch ties each Docker container to their `latest` tag. Latest tagged Docker container always reflect the latest changes and can be compared with a master branch of a git repository. This will look like this in the `docker-compose.yml`
|
||||
|
||||
```shell
|
||||
$ grep '^[[:space:]]*image:' docker-compose.yml
|
||||
|
||||
image: cytopia/bind:latest
|
||||
image: cytopia/${PHP_SERVER:-php-fpm-7.0}:latest
|
||||
image: cytopia/${HTTPD_SERVER:-nginx-stable}:latest
|
||||
image: cytopia/${MYSQL_SERVER:-mariadb-10.1}:latest
|
||||
```
|
||||
|
||||
When you update the devilbox repository by `git pull origin master`, the Docker tags are still `latest` and you will continue using the current version of Docker container. You must also issue `docker-compose pull` in order to also update your Docker container.
|
||||
|
||||
So the update procedure is as follows:
|
||||
|
||||
```shell
|
||||
$ git fetch --all
|
||||
$ git pull origin master
|
||||
$ docker-compose pull
|
||||
```
|
||||
|
||||
**Note:** If you want to pre-download all available versions for later offline-usage, run the `update-docker.sh` script.
|
||||
|
||||
```shell
|
||||
$ ./update-docker.sh
|
||||
```
|
||||
|
||||
## 3. Compare .env file
|
||||
|
||||
New devilbox releases will most likeley receive new or improved functionality and features and therefore will have an altered `env-example` file. (This is an example configuration file which holds all current configuration options).
|
||||
The effective configuration for docker-compose is stored in the `.env` file. However, the `.env` file is ignored by git, so that you can do changes without setting the git state dirty.
|
||||
|
||||
So when you update (master branch or tag) you will always have to compare your current `.env` settings with the new `env-example` file. If you are familiar with vim, just do the following:
|
||||
|
||||
```shell
|
||||
$ vimdiff .env env-example
|
||||
```
|
||||
|
||||
Make sure to transfer all new options from `env-example` to your current `.env` file.
|
||||
|
||||
## 4. Pull new Docker container (Important!)
|
||||
|
||||
As described above, for git master branch updates you will always have to pull new Docker container. **However, there is something very important to keep in mind:**
|
||||
|
||||
1. You have just updated the master branch and pulled new Docker container
|
||||
2. You edit the `.env` file to switch to a different PHP version
|
||||
3. You start up the devilbox. Is your new PHP Docker up to date?
|
||||
|
||||
No! You will have to `docker-compose pull` again. Why?
|
||||
|
||||
Lets have another look into `docker-compose.yml`:
|
||||
|
||||
```yml
|
||||
image: cytopia/${PHP_SERVER:-php-fpm-7.0}:latest
|
||||
image: cytopia/${HTTPD_SERVER:-nginx-stable}:latest
|
||||
image: cytopia/${MYSQL_SERVER:-mariadb-10.1}:latest
|
||||
```
|
||||
|
||||
As you can see, the Docker container names are variablized. If you updated `php-fpm-5.4:latest`, you still have to update `php-fpm-5.5:latest` (and all others) as they were not yet enabled/visible in `docker-compose.yml`.
|
||||
|
||||
So instead of pulling everything manually, use the bundled update script to do that for all available Docker container. That will also allow you to work offline, as every available docker image will be download in their latest version.
|
||||
|
||||
```shell
|
||||
$ ./update-docker.sh
|
||||
```
|
@ -1,68 +0,0 @@
|
||||
# Devilbox Documentation
|
||||
|
||||
[Home](https://github.com/cytopia/devilbox) |
|
||||
[Overview](README.md) |
|
||||
[Configuration](Configuration.md) |
|
||||
[Usage](Usage.md) |
|
||||
Updating |
|
||||
[Info](Info.md) |
|
||||
[PHP Projects](PHP_Projects.md) |
|
||||
[Emails](Emails.md) |
|
||||
[Logs](Logs.md) |
|
||||
[Intranet](Intranet.md) |
|
||||
[FAQ](FAQ.md)
|
||||
|
||||
----
|
||||
|
||||
## Updating
|
||||
|
||||
### Tags vs Branches
|
||||
|
||||
The devilbox git repository offers two types of setups.
|
||||
|
||||
1. Git `tags` for stable release
|
||||
2. The `master` branch with the latest features
|
||||
|
||||
|
||||
### Git tags
|
||||
|
||||
Each new devilbox release is tagged in git and bound to tagged docker images.
|
||||
Updating only involves to check out the latest tag and make sure to stop and remmove your containers prior starting them up again. Latest docker images will be pulled automatically as their docker tag number will also change between releases.
|
||||
|
||||
Additionally you will also have compare `env-example` against your current `.env` file and in case of differences apply them.
|
||||
|
||||
```shell
|
||||
# Update source
|
||||
$ git fetch --all
|
||||
$ git checkout <tag>
|
||||
|
||||
# Stop and remove your container
|
||||
$ docker-compose stop
|
||||
$ docker-compose rm
|
||||
|
||||
# Check for config file changes
|
||||
$ vimdiff .env env-example
|
||||
```
|
||||
|
||||
Currently releases are not that frequent, so you might be better of with the `master` branch.
|
||||
|
||||
### Git master branch
|
||||
|
||||
The `master` branch does not use tagged docker images, but `latest`. So once you git pull you should also pull the latest docker images.
|
||||
|
||||
|
||||
```shell
|
||||
# Update source
|
||||
$ git fetch --all
|
||||
$ git pull origin master
|
||||
|
||||
# Stop and remove your container
|
||||
$ docker-compose stop
|
||||
$ docker-compose rm
|
||||
|
||||
# Pull latest docker images
|
||||
$ docker-compose pull
|
||||
|
||||
# Check for config file changes
|
||||
$ vimdiff .env env-example
|
||||
```
|
348
docs/Usage.md
348
docs/Usage.md
@ -1,131 +1,325 @@
|
||||
# Devilbox Documentation
|
||||
|
||||
[Home](https://github.com/cytopia/devilbox) |
|
||||
[Overview](README.md) |
|
||||
[Configuration](Configuration.md) |
|
||||
[Quickstart](Quickstart.md) |
|
||||
[Install](Install.md) |
|
||||
[Update](Update.md) |
|
||||
[Configure](Configure.md) |
|
||||
[Run](Run.md) |
|
||||
Usage |
|
||||
[Updating](Updating.md) |
|
||||
[Info](Info.md) |
|
||||
[PHP Projects](PHP_Projects.md) |
|
||||
[Emails](Emails.md) |
|
||||
[Logs](Logs.md) |
|
||||
[Intranet](Intranet.md) |
|
||||
[Backups](Backups.md) |
|
||||
[Examples](Examples.md) |
|
||||
[Technical](Technical.md) |
|
||||
[Hacking](Hacking.md) |
|
||||
[FAQ](FAQ.md)
|
||||
|
||||
----
|
||||
---
|
||||
|
||||
## Usage
|
||||
|
||||
This section is about how to start, stop, view and enter (all or a selection of some) containers. If you want to know how to choose the container type version (e.g. which mysql version or which php version) refer to the **[Configuration](Configuration.md)** section.
|
||||
1. [Work on the Docker host](#1-work-on-the-docker-host)
|
||||
2. [Work inside the PHP container](#2-work-inside-the-php-container)
|
||||
1. [As devilbox user](#2-1-as-devilbox-user)
|
||||
2. [As root user](#2-2-as-root-user)
|
||||
3. [Available tools](#2-3-available-tools)
|
||||
4. [Available URLs](#2-4-available-urls)
|
||||
3. [Managing Projects explained](#3-managing-projects-explained)
|
||||
1. [How does it work?](#3-1-how-does-it-work-)
|
||||
2. [Directory structure explained](#3-2-directory-structure-explained)
|
||||
4. [Creating new Projects](#4-creating-new-projetcs)
|
||||
1. [From Docker Host](#4-1-from-docker-host)
|
||||
2. [From inside the PHP container](#4-2-from-inside-the-php-container)
|
||||
3. [Using symlinks](#4-3-using-symlinks)
|
||||
4. [Adding DNS records](#4-4-adding-dns-record)
|
||||
1. [/etc/hosts](#4-4-1-etc-hosts)
|
||||
2. [Auto-DNS](#4-4-2-auto-dns)
|
||||
5. [Switching container versions](#5-switching-container-versions)
|
||||
1. [Httpd versions](#5-1-httpd-versions)
|
||||
2. [PHP versions](#5-2-php-versions)
|
||||
2. [SQL versions](#5-3-sql-versions)
|
||||
3. [NoSQL versions](#5-4-nosql-versions)
|
||||
6. [Emails](#6-emails)
|
||||
7. [Log files](#7-log-files)
|
||||
8. [Intranet](#8-intranet)
|
||||
1. [Overview](#8-1-overview)
|
||||
2. [vHosts](#8-2-vhosts)
|
||||
3. [Tools](#8-3-tools)
|
||||
|
||||
**Convention:** The terms *container* and *service* are used interchangeably.
|
||||
---
|
||||
|
||||
**Assumption:** All `docker-compose` commands must be executed within the devilbox root directory, where the `docker-compose.yml` file resides.
|
||||
## 1. Work on the Docker host
|
||||
|
||||
### 1. Start and Stop
|
||||
If you do not need to run any command line tools manually (composer, node, etc), it is sufficient to stay on the host. All you need is a browser and an editor/IDE.
|
||||
|
||||
#### 1.1 Start all container
|
||||
1. Open your browser at http://localhost
|
||||
2. Open your project inside your editor
|
||||
3. Start coding
|
||||
|
||||
|
||||
**Note:** If you want to do some command-line PHP tasks and you have PHP installed on your host, make sure it is the same version as your currently started PHP Docker container. If not, just enter the PHP Docker and do the tasks there.
|
||||
|
||||
You could however also invoke the Docker's PHP executeable (or any other binary) from your host via:
|
||||
|
||||
```shell
|
||||
$ docker-compose up
|
||||
# Call a generic command
|
||||
$ docker-compose exec --user devilbox php <command>
|
||||
| | | | |
|
||||
use execute use container the
|
||||
docker-compose cmd built-in name actual
|
||||
on the user to command
|
||||
docker devilbox exec to
|
||||
container command execute
|
||||
```
|
||||
|
||||
This will bring up **all containers** defined in `docker-compose.yml`.
|
||||
Here is an example to list the PHP inside the container from the Docker host.
|
||||
```shell
|
||||
# Print PHP version
|
||||
$ docker-compose exec --user devilbox php php -v
|
||||
```
|
||||
|
||||
However, you will probably not need all of the defined services and especially on slow machines you only want to start what you really need. This is possible as well.
|
||||
## 2. Work inside the PHP container
|
||||
|
||||
#### 1.2 Start selected container
|
||||
If you need to run some command line tasks manually such as `drush`, `composer` or anything similar which is not available on your host computer, you can do that inside the PHP container, which comes with lots of useful pre-install tools.
|
||||
|
||||
In order to only start the services you actually need, you must specify them with the docker-compose command.
|
||||
The situation inside the container is not different from on the Docker host. All services and port bindings are available there as well on `127.0.0.1`. Read up on [Technical](Technical.md) to find out more about the syncronization of both.
|
||||
|
||||
**Note:** The `http` and `php` container will automatically be started and must not be explicitly specified. (If not specified, their log output will also not go to stderr/stdout, but instead to docker logs)
|
||||
**FYI:** You will always find your projects inside the PHP container at `/shared/httpd/`.
|
||||
|
||||
#### 2.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.
|
||||
|
||||
```shell
|
||||
# Only start HTTP and PHP
|
||||
$ docker-compose up http php
|
||||
|
||||
# Start HTTP, PHP and Redis
|
||||
$ docker-compose up redis
|
||||
|
||||
# Start HTTP, PHP and MySQL
|
||||
$ docker-compose up mysql
|
||||
|
||||
# Start HTTP, PHP, PostgreSQL and Memcache
|
||||
$ docker-compose up pgsql memcache
|
||||
host> ./bash.sh
|
||||
devilbox@php-7.0.19 in /shared/httpd $
|
||||
```
|
||||
I think you get the idea.
|
||||
|
||||
#### 1.3 Start in background
|
||||
As you can see, the PS1 prompt will also show you the current configured PHP version.
|
||||
|
||||
You can also run the docker compose command in the background and close your terminal after startup. To do so simply add the `-d` flag:
|
||||
#### 2.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.
|
||||
|
||||
```shell
|
||||
$ docker-compose up -d
|
||||
host> ./root_bash.sh
|
||||
root@php-7.0.19 in /shared/httpd $
|
||||
```
|
||||
Or in case of selectively starting
|
||||
|
||||
**Note:** Performing installations and updates are only temporary for the current session. Any change will be lost at the next start/restart of the devilbox. If you permanently require additional software refer to [Hacking](Hacking.md).
|
||||
|
||||
#### 2.3 Available tools
|
||||
|
||||
For your convenience a few selected tools have been pre-installed in their current version that you can use for your daily development tasks. Some of them are:
|
||||
|
||||
*composer, drush, drupal-console, git, node, npm*
|
||||
|
||||
The complete list of tools including their version can be found at the PHP docker containers git repository Readme:
|
||||
|
||||
[PHP 5.4](https://github.com/cytopia/docker-php-fpm-5.4) |
|
||||
[PHP 5.5](https://github.com/cytopia/docker-php-fpm-5.5) |
|
||||
[PHP 5.6](https://github.com/cytopia/docker-php-fpm-5.6) |
|
||||
[PHP 7.0](https://github.com/cytopia/docker-php-fpm-7.0) |
|
||||
[PHP 7.1](https://github.com/cytopia/docker-php-fpm-7.1) |
|
||||
[HHVM](https://github.com/cytopia/docker-hhvm-latest)
|
||||
|
||||
If you permanently require additional software refer to [Hacking](Hacking.md).
|
||||
|
||||
If you think additional tools should always be bundled, [create an issue](https://github.com/cytopia/devilbox/issues).
|
||||
|
||||
#### 2.4 Available URLs
|
||||
|
||||
Your projects will be available by the same URL as they are available from your docker host computer. There is no need to edit the PHP container's `/etc/hosts` file, as it is automatically provide via the DNS container `bind`.
|
||||
|
||||
For example, by doing `curl http://project1.dev` from either your host computer or from inside the PHP container will return the same URL.
|
||||
|
||||
## 3. Managing Projects explained
|
||||
[](https://www.youtube.com/watch?v=reyZMyt2Zzo)
|
||||
|
||||
#### 3.1 How does it work?
|
||||
|
||||
Creating new projects is really simple and just involves a few steps.
|
||||
|
||||
1. Create a new **project folder** for your VirtualHost
|
||||
2. Create a subfolder named **htdocs/** for the DocumentRoot
|
||||
2. Create a **DNS record** pointing to your VirtualHost (via `/etc/hosts`)
|
||||
|
||||
The **project folder** will be the name of your VirtualHost. The **htdocs/** folder holds all files that will be server by the VirtualHost (called DocumentRoot). The **DNS record** will be the domain name that points to the webserver's IP address (127.0.0.1).
|
||||
|
||||
#### 3.2 Directory structure explained
|
||||
|
||||
Your project folder is determined by the value of `HOST_PATH_TO_HTTPD_DATADIR` which can be set in `.env`. The default is `./data/www`.
|
||||
|
||||
| Location | Project directory |
|
||||
|--------------|-------------------|
|
||||
| Host system | `HOST_PATH_TO_HTTPD_DATADIR` (default: `./data/www`) |
|
||||
| PHP Docker | `/shared/httpd` |
|
||||
| HTTPD Docker | `/shared/httpd` |
|
||||
|
||||
|
||||
**What directory structure is required to serve a new project?**
|
||||
|
||||
1. Each folder inside your project directory is an independent VirtualHost.
|
||||
2. Each VirtualHost folder requires the `htdocs/` folder which is the DocumentRoot.
|
||||
|
||||
In order to make the following examples easier let's work with some assumed default values. The first one represents the project base directory and the second one is for the project domains.
|
||||
|
||||
1. HOST_PATH_TO_HTTPD_DATADIR=**./data/www**
|
||||
2. TLD_SUFFIX=**local**
|
||||
|
||||
| VirtualHost directory | DocumentRoot directory | URL |
|
||||
|-----------------------|-----------------------------|------------------------|
|
||||
| <code>./data/www/<b>project1</b></code> | <code>./data/www/project1/<b>htdocs</b></code> | `http://project1.local` |
|
||||
| <code>./data/www/<b>project2</b></code> | <code>./data/www/project2/<b>htdocs</b></code> | `http://project2.local` |
|
||||
| <code>./data/www/<b>wordpress</b></code>| <code>./data/www/wordpress/<b>htdocs</b></code> | `http://wordpress.local` |
|
||||
|
||||
The VirtualHost directory make a new VirtualHost available under the specified URL. However the actual files that will be served are always expected to be in a subfolder called `htdocs/`. By having an additional sub-directory for the Document root you are able to store non-www files inside the project folder and even **symlink** you www dir to htdocs.
|
||||
|
||||
|
||||
## 4. Creating new Projetcs
|
||||
|
||||
This is a general overview about creating projects. If you want to see some real examples how to setup **Wordpress**, **Drupal**, **CakePHP**, **Yii**, **Symfony** and others, visit the [Example Section](Examples.md).
|
||||
|
||||
#### 4.1 From Docker host
|
||||
|
||||
The following will create a VirtualHost for `http://project1.local`.
|
||||
|
||||
```shell
|
||||
$ docker-compose up -d mysql
|
||||
# replace HOST_PATH_TO_HTTPD_DATADIR with the actual project base dir
|
||||
$ cd HOST_PATH_TO_HTTPD_DATADIR
|
||||
$ mkdir project1
|
||||
$ mkdir project1/htdocs
|
||||
```
|
||||
|
||||
#### 1.4 Stop container
|
||||
<sub>If you want to know how to change the TLD_SUFFIX `local` to something else, refer to [Configure](Configure.md).</sub>
|
||||
|
||||
1. If you started up docker compose in foreground mode (without `-d`), you can hit `ctrl+c` to gracefull stop or **twice** `ctrl+c` to kill the running containers.<br/>**Note:** Automatically started containers that were not specified (such as `http` or `php`) will have to be stopped manually via `docker-compose down` afterwards.
|
||||
2. If you started up docker compose in background mode (with `-d`), go back to the devilbox directory (where the `docker-compose.yml` file resides and type `docker-compose down` to gracefully stop or `docker-compose kill` to kill them immediately.
|
||||
#### 4.2 From inside the PHP container
|
||||
|
||||
Best pracice would be to start the container in the background (with `-d`) and use `docker compose down` to gracefully stop all of them.
|
||||
If you prefer to work directly inside the PHP Docker container, you can do the same. The following will create a VirtualHost for `http://project1.local`.
|
||||
|
||||
### 2. Container Info
|
||||
|
||||
#### 2.1 List running container
|
||||
|
||||
Inside the devilbox directory enter the following command to get a list of the started/running container:
|
||||
```shell
|
||||
$ docker-compose ps
|
||||
$ cd /shared/httpd
|
||||
$ mkdir project1
|
||||
$ mkdir project1/htdocs
|
||||
```
|
||||
|
||||
#### 2.2 Show container stdout/stderr output
|
||||
<sub>If you want to know how to go into the PHP container, check the section above **2. Work inside the PHP container**.</sub>
|
||||
|
||||
Services started in background mode (`-d`) or those that were started as dependencies (`http` and `php`) will always only log to docker logs and not to stdout/stderr. In order to view their output use:
|
||||
#### 4.3 Using symlinks
|
||||
|
||||
Instead of creating a **htdocs/** folder explicitly, you can also make a symlink by the same name. This is required as some frameworks have nested www folders.
|
||||
|
||||
Keep the actual versioned wordpress name and symlink it to htdocs.
|
||||
```shell
|
||||
$ docker-compose logs
|
||||
$ ls -l
|
||||
drwxrwxr-x 2 cytopia 4096 Jun 14 08:29 wordpress-4.8
|
||||
lrwxrwxrwx 1 cytopia 11 Jun 14 08:29 htdocs -> wordpress-4.8/
|
||||
```
|
||||
|
||||
### 3. Enter
|
||||
|
||||
#### 3.1 Enter the php container
|
||||
|
||||
The `php` container (which might also have hhvm installed, depending on your version choice) is the container you can use to enter if you want to execute commands with the specified php version.
|
||||
|
||||
> **Note:** If you also have php installed locally on your host machine (and it is the php version of your choice), there is no need to enter the php container, just execute all the required commands on your project dir.
|
||||
|
||||
To enter the php container, type the following in the devilbox root directory:
|
||||
```shel
|
||||
$ ./bash.sh
|
||||
```
|
||||
You can alternatively also enter as root:
|
||||
```
|
||||
$ ./root_bash.sh
|
||||
CakePHP serves its files from a nested folder, a symlink is required here.
|
||||
```shell
|
||||
$ ls -l
|
||||
drwxrwxr-x 2 cytopia 4096 Jun 14 08:29 cakephp
|
||||
lrwxrwxrwx 1 cytopia 11 Jun 14 08:29 htdocs -> cakephp/app/webroot/
|
||||
```
|
||||
|
||||
#### 3.2 Find your project files
|
||||
#### 4.4 Adding DNS record
|
||||
|
||||
The `php` container mounts your project files (the path of `HOST_PATH_TO_WWW_DOCROOTS` as specified in the `.env` file) to `/shared/httpd`.
|
||||
In order to actually visit the newly created project in your browser, there must be a DNS entry pointing to the webserver's listening IP address. This can either be done automatically by a DNS server or you can do it manually for each project by editing your `/etc/hosts` file every time you create a new project.
|
||||
|
||||
So enter the container as described above and once inside the `php` container cd into `/shared/httpd`.
|
||||
##### 4.4.1 /etc/hosts
|
||||
|
||||
----
|
||||
If you have not setup Auto-DNS, you will need to create your own DNS records for every project. Let's assume your `TLD_SUFFIX` is set to `local`.
|
||||
|
||||
### Hints
|
||||
| Project folder | `/etc/hosts` entry |
|
||||
|----------------|-------------------------------|
|
||||
| my-project1 | `127.0.0.1 my-project1.local` |
|
||||
| drupal-test | `127.0.0.1 drupal-test.local` |
|
||||
| playground | `127.0.0.1 playground.local` |
|
||||
|
||||
**A. How do I know the name of the container I can start?**
|
||||
|
||||
Refer to the **[Info](Info.md)** section or look it up in the `docker-compose.yml` file.
|
||||
##### 4.4.2 Auto-DNS
|
||||
|
||||
**B. Can I not just comment out the service in the `.env` file?**
|
||||
When using the devilbox built-in DNS server, there is nothing to do. DNS catch-all records for your `TLD_SUFFIX` exist and will always point to `127.0.0.1`. See [Configure](Configure.md) for how to setup Auto-DNS.
|
||||
|
||||
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.
|
||||
|
||||
**C. Are there any required services that must/will always be started?**
|
||||
## 5. Switching container versions
|
||||
|
||||
Yes. `http` and `php` will automatically always be started (due to dependencies inside `docker-compose.yml`) if you specify them or not.
|
||||
Being able to combine all kinds of different container version is one of the main goals of the devilbox. Changing the versions is kept simple and consistent for all container.
|
||||
|
||||
1. Open the `.env` file in your favorite editor
|
||||
2. Find the `*_SERVER=` block for the container to change the version
|
||||
3. Comment all lines you do not want to activate
|
||||
4. Uncomment the one line you want to use.
|
||||
5. Restart the devilbox for the changes to take effect
|
||||
|
||||
<sub>Be aware that if multiple lines are uncommented, the last one takes effect.</sub>
|
||||
|
||||
#### 5.1 Httpd versions
|
||||
|
||||
1. Open the `.env` file in your favorite editor
|
||||
2. Find the `HTTPD_SERVER=` block
|
||||
|
||||
You can choose between Apache and Nginx in different version. All of them are configured to work the same, there is nothing to worry about when changing them.
|
||||
|
||||
|
||||
#### 5.2 PHP versions
|
||||
|
||||
1. Open the `.env` file in your favorite editor
|
||||
2. Find the `PHP_SERVER=` block
|
||||
|
||||
You can choose between different PHP versions and HHVM.
|
||||
|
||||
**Important:** Keep in mind that if you have a custom php.ini config at `./cfg/php-*/`, it is only effective for one version. Custom php configurations are separted per version.
|
||||
|
||||
#### 5.3 SQL versions
|
||||
|
||||
1. Open the `.env` file in your favorite editor
|
||||
2. Find the `MYSQL_SERVER=` or `PGSQL_SERVER=` block
|
||||
|
||||
**Important:** Each version has a different data directory. This is a security precautions. Imagine you startup MySQL 5.5 for the first time. New databases will be created. Now you startup MySQL 8. All existing databases would be upgraded to work flawlessly with MySQL 8, however this is not downwards compatible. So by startup up MySQL 5.5 again, it would say the database is corrupt.
|
||||
|
||||
#### 5.4 NoSQL versions
|
||||
|
||||
1. Open the `.env` file in your favorite editor
|
||||
2. Find the `MONGO_SERVER=`, 'MEMCD_SERVER=` or `REDIS_SERVER=` block
|
||||
|
||||
There is nothing to pay attention to here.
|
||||
|
||||
## 6. Emails
|
||||
|
||||
All your projects can send emails to whatever recipient. You do not have to worry that they will actually being sent. Each PHP container runs a local postfix mailserver that intercepts all outgoing mails and puts them all in the local devilbox user mail account.
|
||||
|
||||
In order to view sent emails open up the devilbox intranet http://localhost/mail.php. There you can also test email sending and verify that they really stay locally.
|
||||
|
||||
## 7. Log files
|
||||
|
||||
Log files are available on the Host system and separated per service version. See `./log/` (inside devilbox git directory) for all log files.
|
||||
|
||||
## 8. Intranet
|
||||
|
||||
The devilbox bundled intranet is not required for project management or creation, however it offers a few useful tools.
|
||||
|
||||
#### 8.1 Overview
|
||||
|
||||
The overview page presents you the current state of the running stack and any errors it might have encountered.
|
||||
|
||||
http://localhost
|
||||
|
||||
#### 8.2 vHosts
|
||||
|
||||
The vHost page shows you all available projects and any configuation errors that need to be resolved. Errors could be: missing `htdocs/` folder and incorrect DNS settings. So make sure to first visit this page if any of your vHost does not work.
|
||||
|
||||
http://localhost/vhosts.php
|
||||
|
||||
#### 8.3 Tools
|
||||
|
||||
The intranet also offers a few common as well as self-made tools. These include:
|
||||
|
||||
* phpMyAdmin
|
||||
* Adminer
|
||||
* Mail viewer
|
||||
* OpCacheGUI
|
||||
* SQL/NoSQL database viewer
|
||||
* Info pages (showing detailed configurations for the attached container)
|
||||
|
||||
If you are interested in doing database backups, either use phpMyAdmin or Adminer. You can however also use the PHP container itself. Read more about this on [Backups](Backups.md)
|
||||
|
@ -1,2 +0,0 @@
|
||||
theme: jekyll-theme-slate
|
||||
google_analytics: UA-51797082-4
|
@ -1,62 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ site.lang | default: "en-US" }}">
|
||||
|
||||
<head>
|
||||
<meta charset='utf-8'>
|
||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||
<meta name="viewport" content="width=device-width,maximum-scale=2">
|
||||
<meta name="description" content="{{ site.title | default: site.github.repository_name }} : {{ site.description | default: site.github.project_tagline }}">
|
||||
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="{{ '/assets/css/style.css?v=' | append: site.github.build_revision | relative_url }}">
|
||||
|
||||
<title>{{ site.title | default: site.github.repository_name }}</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!-- HEADER -->
|
||||
<div id="header_wrap" class="outer">
|
||||
<header class="inner">
|
||||
<a id="forkme_banner" href="{{ site.github.repository_url }}">View on GitHub</a>
|
||||
|
||||
<h1 id="project_title">{{ site.title | default: site.github.repository_name }}</h1>
|
||||
<h2 id="project_tagline">{{ site.description | default: site.github.project_tagline }}</h2>
|
||||
|
||||
{% if site.show_downloads %}
|
||||
<section id="downloads">
|
||||
<a class="zip_download_link" href="{{ site.github.zip_url }}">Download this project as a .zip file</a>
|
||||
<a class="tar_download_link" href="{{ site.github.tar_url }}">Download this project as a tar.gz file</a>
|
||||
</section>
|
||||
{% endif %}
|
||||
</header>
|
||||
</div>
|
||||
|
||||
<!-- MAIN CONTENT -->
|
||||
<div id="main_content_wrap" class="outer">
|
||||
<section id="main_content" class="inner">
|
||||
{{ content }}
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!-- FOOTER -->
|
||||
<div id="footer_wrap" class="outer">
|
||||
<footer class="inner">
|
||||
{% if site.github.is_project_page %}
|
||||
<p class="copyright">{{ site.title | default: site.github.repository_name }} maintained by <a href="{{ site.github.owner_url }}">{{ site.github.owner_name }}</a></p>
|
||||
{% endif %}
|
||||
<p>Published with <a href="https://pages.github.com">GitHub Pages</a></p>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
{% if site.google_analytics %}
|
||||
<script type="text/javascript">
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||
ga('create', '{{ site.google_analytics }}', 'auto');
|
||||
ga('send', 'pageview');
|
||||
</script>
|
||||
{% endif %}
|
||||
</body>
|
||||
</html>
|
@ -1,46 +0,0 @@
|
||||
---
|
||||
---
|
||||
|
||||
@import "{{ site.theme }}";
|
||||
|
||||
.inner {
|
||||
max-width: 850px;
|
||||
position: relative;
|
||||
padding: 20px 10px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
#header_wrap {
|
||||
background-image: url('/assets/img/devilbox-dash.png');
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
min-height: 100%;
|
||||
}
|
||||
h1, h2, h3 {
|
||||
text-align: center;
|
||||
}
|
||||
h2, h3 {
|
||||
margin-top:30px;
|
||||
}
|
||||
|
||||
|
||||
table {
|
||||
margin: auto;
|
||||
width: 50%;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.center {
|
||||
text-align: center;
|
||||
}
|
||||
img.battery {
|
||||
/*border: 1px solid black;*/
|
||||
border-radius: 15px;
|
||||
}
|
||||
|
||||
/* remove gh pages link */
|
||||
footer.inner p {
|
||||
display: none;
|
||||
}
|
||||
footer.inner p.copyright {
|
||||
display: block;
|
||||
}
|
101
update-docker.sh
Executable file
101
update-docker.sh
Executable file
@ -0,0 +1,101 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# This script will pull all Docker images that are currently
|
||||
# bound to your devilbox git state.
|
||||
#
|
||||
# When updating the devilbox via git, do run this script once
|
||||
# in order to download all images locally.
|
||||
#
|
||||
|
||||
###
|
||||
### Path of devilbox repository
|
||||
###
|
||||
CWD="$(cd -P -- "$(dirname -- "$0")" && pwd -P)"
|
||||
|
||||
###
|
||||
### DNS
|
||||
###
|
||||
TAG="$( grep '^[[:space:]]*image:[[:space:]]*cytopia/bind' "${CWD}/docker-compose.yml" | sed 's/^.*://g' )"
|
||||
docker pull cytopia/bind:${TAG}
|
||||
|
||||
###
|
||||
### PHP
|
||||
###
|
||||
TAG="$( grep '^[[:space:]]*image:.*\${PHP_SERVER' "${CWD}/docker-compose.yml" | sed 's/^.*://g' )"
|
||||
docker pull cytopia/php-fpm-5.4:${TAG}
|
||||
docker pull cytopia/php-fpm-5.5:${TAG}
|
||||
docker pull cytopia/php-fpm-5.6:${TAG}
|
||||
docker pull cytopia/php-fpm-7.0:${TAG}
|
||||
docker pull cytopia/php-fpm-7.1:${TAG}
|
||||
docker pull cytopia/hhvm-latest:${TAG}
|
||||
|
||||
###
|
||||
### HTTPD
|
||||
###
|
||||
TAG="$( grep '^[[:space:]]*image:.*\${HTTPD_SERVER' "${CWD}/docker-compose.yml" | sed 's/^.*://g' )"
|
||||
docker pull cytopia/nginx-stable:${TAG}
|
||||
docker pull cytopia/nginx-mainline:${TAG}
|
||||
docker pull cytopia/apache-2.2:${TAG}
|
||||
docker pull cytopia/apache-2.4:${TAG}
|
||||
|
||||
###
|
||||
### MYSQL
|
||||
###
|
||||
TAG="$( grep '^[[:space:]]*image:.*\${MYSQL_SERVER' "${CWD}/docker-compose.yml" | sed 's/^.*://g' )"
|
||||
docker pull cytopia/mysql-5.5:${TAG}
|
||||
docker pull cytopia/mysql-5.6:${TAG}
|
||||
docker pull cytopia/mysql-5.7:${TAG}
|
||||
docker pull cytopia/mysql-8.0:${TAG}
|
||||
docker pull cytopia/mariadb-5.5:${TAG}
|
||||
docker pull cytopia/mariadb-10.0:${TAG}
|
||||
docker pull cytopia/mariadb-10.1:${TAG}
|
||||
docker pull cytopia/mariadb-10.2:${TAG}
|
||||
docker pull cytopia/mariadb-10.3:${TAG}
|
||||
|
||||
###
|
||||
### PGSQL
|
||||
###
|
||||
docker pull postgres:9.1
|
||||
docker pull postgres:9.2
|
||||
docker pull postgres:9.3
|
||||
docker pull postgres:9.4
|
||||
docker pull postgres:9.5
|
||||
docker pull postgres:9.6
|
||||
|
||||
###
|
||||
### REDIS
|
||||
###
|
||||
docker pull redis:2.8
|
||||
docker pull redis:3.0
|
||||
docker pull redis:3.2
|
||||
|
||||
###
|
||||
### MEMCACHED
|
||||
###
|
||||
docker pull memcached:1.4.21
|
||||
docker pull memcached:1.4.22
|
||||
docker pull memcached:1.4.23
|
||||
docker pull memcached:1.4.24
|
||||
docker pull memcached:1.4.25
|
||||
docker pull memcached:1.4.26
|
||||
docker pull memcached:1.4.27
|
||||
docker pull memcached:1.4.28
|
||||
docker pull memcached:1.4.29
|
||||
docker pull memcached:1.4.30
|
||||
docker pull memcached:1.4.31
|
||||
docker pull memcached:1.4.32
|
||||
docker pull memcached:1.4.33
|
||||
docker pull memcached:1.4.34
|
||||
docker pull memcached:1.4.35
|
||||
docker pull memcached:1.4.36
|
||||
docker pull memcached:latest
|
||||
|
||||
###
|
||||
### MONGODB
|
||||
###
|
||||
docker pull mongo:2.8
|
||||
docker pull mongo:3.0
|
||||
docker pull mongo:3.2
|
||||
docker pull mongo:3.4
|
||||
docker pull mongo:3.5
|
||||
|
Loading…
x
Reference in New Issue
Block a user