mirror of
https://github.com/cytopia/devilbox.git
synced 2024-12-23 14:42:25 +00:00
DVL-016 Run the devilbox
This commit is contained in:
parent
6e14f36735
commit
11242dac1f
@ -4,6 +4,7 @@
|
||||
**Installing** |
|
||||
**Updating** |
|
||||
**Configuration** |
|
||||
**[Run](Run.md)** |
|
||||
**[Usage](Usage.md)** |
|
||||
**Examples** |
|
||||
**[Technical](Technical.md)** |
|
||||
|
11
docs/FAQ.md
11
docs/FAQ.md
@ -4,6 +4,7 @@
|
||||
**Installing** |
|
||||
**Updating** |
|
||||
**Configuration** |
|
||||
**[Run](Run.md)** |
|
||||
**[Usage](Usage.md)** |
|
||||
**[Examples](Examples.md)** |
|
||||
**[Technical](Technical.md)** |
|
||||
@ -42,3 +43,13 @@ The `.env` file allows you to configure the devilbox, but not to start services
|
||||
**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?**
|
||||
|
||||
**Can I add other PHP Modules?**
|
||||
|
||||
**Can I change php.ini?**
|
||||
|
||||
**Can I change my.cnf?**
|
||||
|
||||
**Can I switch HHVM between PHP 5.6 and PHP 7 mode?**
|
||||
|
@ -4,6 +4,7 @@
|
||||
**Installing** |
|
||||
**Updating** |
|
||||
**Configuration** |
|
||||
**[Run](Run.md)** |
|
||||
**[Usage](Usage.md)** |
|
||||
**[Examples](Examples.md)** |
|
||||
**[Technical](Technical.md)** |
|
||||
|
@ -4,6 +4,7 @@
|
||||
**Installing** |
|
||||
**Updating** |
|
||||
**Configuration** |
|
||||
**[Run](Run.md)** |
|
||||
**[Usage](Usage.md)** |
|
||||
**[Examples](Examples.md)** |
|
||||
**[Technical](Technical.md)** |
|
||||
@ -93,6 +94,7 @@ If you have never worked with docker/docker-compose before, you should check up
|
||||
| **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 |
|
||||
|
133
docs/Run.md
Normal file
133
docs/Run.md
Normal file
@ -0,0 +1,133 @@
|
||||
# Devilbox Documentation
|
||||
|
||||
**[Overview](README.md)** |
|
||||
**Installing** |
|
||||
**Updating** |
|
||||
**Configuration** |
|
||||
**Run** |
|
||||
**[Usage](Usage.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)
|
||||
|
||||
|
||||
---
|
||||
|
||||
### 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.
|
||||
|
||||
#### 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
|
||||
```
|
||||
|
||||
**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
|
||||
```
|
||||
|
||||
##### 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
|
||||
```
|
||||
|
||||
**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
|
||||
```
|
||||
|
||||
### 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.
|
||||
|
||||
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,6 +4,7 @@
|
||||
**Installing** |
|
||||
**Updating** |
|
||||
**Configuration** |
|
||||
**[Run](Run.md)** |
|
||||
**[Usage](Usage.md)** |
|
||||
**[Examples](Examples.md)** |
|
||||
**Technical** |
|
||||
|
136
docs/Usage.md
136
docs/Usage.md
@ -4,6 +4,7 @@
|
||||
**Installing** |
|
||||
**Updating** |
|
||||
**Configuration** |
|
||||
**[Run](Run.md)** |
|
||||
**Usage** |
|
||||
**[Examples](Examples.md)** |
|
||||
**[Technical](Technical.md)** |
|
||||
@ -43,21 +44,87 @@
|
||||
|
||||
### 1. Start and Stop
|
||||
|
||||
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/)
|
||||
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.
|
||||
|
||||
#### 1.1 Normal 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.
|
||||
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
|
||||
```
|
||||
|
||||
**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
|
||||
```
|
||||
|
||||
##### 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
|
||||
```
|
||||
|
||||
**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
|
||||
```
|
||||
|
||||
#### 1.4 Normal Stop
|
||||
#### 1.5 Selective stop
|
||||
#### 1.6 Attach/Detach during run-time
|
||||
|
||||
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.
|
||||
|
||||
Best pracice would be to start the container in the background (with `-d`) and use `docker compose down` to gracefully stop all of them.
|
||||
|
||||
#### 1.5 Selective stop
|
||||
|
||||
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
|
||||
```
|
||||
|
||||
#### 1.6 Attach/Detach during run-time
|
||||
|
||||
|
||||
|
||||
### 2. Creating Projects
|
||||
|
||||
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.
|
||||
@ -66,66 +133,7 @@ This section is about how to start, stop, view and enter (all or a selection of
|
||||
|
||||
**Assumption:** All `docker-compose` commands must be executed within the devilbox root directory, where the `docker-compose.yml` file resides.
|
||||
|
||||
### 1. Start and Stop
|
||||
|
||||
#### 1.1 Start all container
|
||||
|
||||
```shell
|
||||
$ docker-compose up
|
||||
```
|
||||
|
||||
This will bring up **all containers** defined in `docker-compose.yml`.
|
||||
|
||||
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.
|
||||
|
||||
#### 1.2 Start selected container
|
||||
|
||||
In order to only start the services you actually need, you must specify them with the docker-compose command.
|
||||
|
||||
**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)
|
||||
|
||||
```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
|
||||
```
|
||||
I think you get the idea.
|
||||
|
||||
#### 1.3 Start in background
|
||||
|
||||
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:
|
||||
|
||||
```shell
|
||||
$ docker-compose up -d
|
||||
```
|
||||
Or in case of selectively starting
|
||||
```shell
|
||||
$ docker-compose up -d mysql
|
||||
```
|
||||
|
||||
#### 1.4 Stop container
|
||||
|
||||
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.
|
||||
|
||||
Best pracice would be to start the container in the background (with `-d`) and use `docker compose down` to gracefully stop all of them.
|
||||
|
||||
### 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
|
||||
```
|
||||
``
|
||||
|
||||
#### 2.2 Show container stdout/stderr output
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user