Skip to content
This repository was archived by the owner on Mar 15, 2019. It is now read-only.

Commit

Permalink
updating templates & commands for Orbit v2.0.0 + adding health check …
Browse files Browse the repository at this point in the history
…of modules + updating some services versions (#45)
  • Loading branch information
gulien authored Sep 27, 2017
1 parent e20cf11 commit ce1f4a8
Show file tree
Hide file tree
Showing 23 changed files with 190 additions and 271 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ before_install:
- curl -L https://github.com/docker/compose/releases/download/1.14.0/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
- wget https://github.com/gulien/orbit/releases/download/v1.0.0/orbit_Linux_x86_64.tar.gz && tar -xzf orbit*.tar.gz orbit && rm -f orbit*.tar.gz
- wget https://github.com/gulien/orbit/releases/download/v2.0.0/orbit_Linux_x86_64.tar.gz && tar -xzf orbit*.tar.gz orbit && rm -f orbit*.tar.gz
- sudo mv ./orbit /usr/local/bin && chmod +x /usr/local/bin/orbit

script:
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<h3 align="center">kickoff-docker-php</h3>
<p align="center">A complete stack for your PHP project powered by Docker</p>
<p align="center">
<a href="https://github.com/thecodingmachine/kickoff-docker-php/tree/v2.0.3"><img src="https://img.shields.io/badge/stable-v2.0.3-green.svg" alt="Stable release: v2.0.3"></a>
<a href="https://github.com/thecodingmachine/kickoff-docker-php/tree/v2.1.0"><img src="https://img.shields.io/badge/stable-v2.1.0-green.svg" alt="Stable release: v2.1.0"></a>
<a href="https://github.com/thecodingmachine/kickoff-docker-php/tree/master"><img src="https://img.shields.io/badge/unstable-master-orange.svg" alt="Unstable release: master"></a>
<a href="https://travis-ci.org/thecodingmachine/kickoff-docker-php"><img src="https://img.shields.io/travis/thecodingmachine/kickoff-docker-php.svg?label=Travis+CI" alt="Travis CI"></a>
</p>
Expand Down Expand Up @@ -58,7 +58,7 @@ On Linux, you also have to install [Docker compose](https://docs.docker.com/comp
come with by default. Also add your current user to the `docker` group and don't forget to logout/login from your current
session.

Then download and install [Orbit](https://github.com/gulien/orbit) (**1.0.0**), a tool for generating files from templates and
Then download and install [Orbit](https://github.com/gulien/orbit) (**>= 2.0.0**), a tool for generating files from templates and
running commands.

You may now fork this project and clone it or download the latest release from the [releases page](../../releases).
Expand Down Expand Up @@ -121,8 +121,9 @@ and check if everything is OK!

## Orbit commands

| Command | description |
| Command | Description |
|------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------|
| `orbit run` | Displays available Orbit commands. |
| `orbit run kickoff` | Generates all configuration files, builds the NGINX and PHP-FPM images and starts the containers. It's a combo of `build`, `proxy-up` and `up` commands. |
| `orbit run shutdown` | Stops all containers. It's a combo of `down` and `proxy-down` commands. |
| `orbit run build` | Generates all configuration files and builds the NGINX and PHP-FPM images. |
Expand All @@ -133,6 +134,8 @@ and check if everything is OK!
| `orbit run workspace` | Connects through ash to the PHP-FPM container. This is where you're able to run useful commands like `composer` and `yarn`. |
| `orbit run mysql-cli` | Opens the MySQL cli as `root`. On environments <> `local`, it will ask you the MySQL `root` password. |

**Note:** You can use the `-d` flag to have a more detailed output.

## Project structure

```
Expand Down
76 changes: 38 additions & 38 deletions config/orbit/orbit-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ commands:
# | Generates Docker Sync configuration file.
# |

- use: "docker-sync-build"
- use: docker-sync-build
run:
{{ if eq "true" .EnvFiles.Config.ENABLE_DOCKER_SYNC }}
- orbit generate -t docker-sync.blueprint.yml -o docker-sync.yml -v Project,config/project.yml -e Config,config/.env
- orbit run script-fix-permissions-docker-sync -c config/orbit/orbit-scripts.yml -v Project,config/project.yml;Modules,config/modules.yml -e Config,config/.env
{{ else if eq "windows" .Os }}
- orbit generate -t docker-sync.blueprint.yml -o docker-sync.yml -v Project,config/project.yml -e Config,config/.env {{ if debug }}-d{{ end }}
- orbit run script-fix-permissions-docker-sync -c config/orbit/orbit-scripts.yml -v Project,config/project.yml;Modules,config/modules.yml -e Config,config/.env {{ if debug }}-d{{ end }}
{{ else if eq "windows" os }}
- cmd.exe /c echo Skipping Docker Sync configuration file generation ...
{{ else }}
- echo Skipping Docker Sync configuration file generation ...
Expand All @@ -35,9 +35,9 @@ commands:
# | Generates Toolbox configuration files.
# |

- use: "toolbox-build"
- use: toolbox-build
run:
- orbit generate -t modules/toolbox/docker-compose.blueprint.yml -o modules/toolbox/docker-compose.yml -v Project,config/project.yml;Modules,config/modules.yml -e Config,config/.env
- orbit generate -t modules/toolbox/docker-compose.blueprint.yml -o modules/toolbox/docker-compose.yml -v Project,config/project.yml;Modules,config/modules.yml -e Config,config/.env {{ if debug }}-d{{ end }}

# |--------------------------------------------------------------------------
# | orbit run traefik-build
Expand All @@ -46,12 +46,12 @@ commands:
# | Generates Traefik configuration files.
# |

- use: "traefik-build"
- use: traefik-build
run:
- orbit run script-traefik-self-signed-certificate -c config/orbit/orbit-scripts.yml -v Project,config/project.yml;Modules,config/modules.yml -e Config,config/.env
- orbit run script-traefik-htdigest -c config/orbit/orbit-scripts.yml -v Project,config/project.yml;Modules,config/modules.yml -e Config,config/.env
- orbit generate -t modules/traefik/traefik.blueprint.toml -o modules/traefik/traefik.toml -v Project,config/project.yml -e Config,config/.env
- orbit generate -t modules/traefik/docker-compose.blueprint.yml -o modules/traefik/docker-compose.yml -v Project,config/project.yml;Modules,config/modules.yml -e Config,config/.env
- orbit run script-traefik-self-signed-certificate -c config/orbit/orbit-scripts.yml -v Project,config/project.yml;Modules,config/modules.yml -e Config,config/.env {{ if debug }}-d{{ end }}
- orbit run script-traefik-htdigest -c config/orbit/orbit-scripts.yml -v Project,config/project.yml;Modules,config/modules.yml -e Config,config/.env {{ if debug }}-d{{ end }}
- orbit generate -t modules/traefik/traefik.blueprint.toml -o modules/traefik/traefik.toml -v Project,config/project.yml -e Config,config/.env {{ if debug }}-d{{ end }}
- orbit generate -t modules/traefik/docker-compose.blueprint.yml -o modules/traefik/docker-compose.yml -v Project,config/project.yml;Modules,config/modules.yml -e Config,config/.env {{ if debug }}-d{{ end }}

# |--------------------------------------------------------------------------
# | orbit run graylog-build
Expand All @@ -60,13 +60,13 @@ commands:
# | Generates Graylog configuration files.
# |

- use: "graylog-build"
- use: graylog-build
run:
{{ if eq true .Values.Modules.graylog.enable }}
- orbit generate -t modules/graylog/docker-compose.blueprint.yml -o modules/graylog/docker-compose.yml -v Project,config/project.yml;Modules,config/modules.yml -e Config,config/.env
- orbit generate -t modules/graylog/udp-input.blueprint.json -o modules/graylog/udp-input.json -e Config,config/.env
- orbit run script-graylog-secrets -c config/orbit/orbit-scripts.yml -v Project,config/project.yml;Modules,config/modules.yml -e Config,config/.env
{{ else if eq "windows" .Os }}
- orbit generate -t modules/graylog/docker-compose.blueprint.yml -o modules/graylog/docker-compose.yml -v Project,config/project.yml;Modules,config/modules.yml -e Config,config/.env {{ if debug }}-d{{ end }}
- orbit generate -t modules/graylog/udp-input.blueprint.json -o modules/graylog/udp-input.json -e Config,config/.env {{ if debug }}-d{{ end }}
- orbit run script-graylog-secrets -c config/orbit/orbit-scripts.yml -v Project,config/project.yml;Modules,config/modules.yml -e Config,config/.env {{ if debug }}-d{{ end }}
{{ else if eq "windows" os }}
- cmd.exe /c echo Skipping Graylog configuration files generation ...
{{ else }}
- echo Skipping Graylog configuration files generation ...
Expand All @@ -79,14 +79,14 @@ commands:
# | Generates PHP-FPM configuration files and builds the image.
# |

- use: "php-fpm-build"
- use: php-fpm-build
run:
- orbit generate -t modules/php-fpm/docker-compose.blueprint.yml -o modules/php-fpm/docker-compose.yml -v Project,config/project.yml;Modules,config/modules.yml -e Config,config/.env
- orbit run script-fix-permissions-php-fpm -c config/orbit/orbit-scripts.yml -v Project,config/project.yml;Modules,config/modules.yml -e Config,config/.env
- orbit generate -t modules/php-fpm/conf.d/memory-limit.blueprint.ini -o modules/php-fpm/conf.d/memory-limit.ini -e Config,config/.env
- orbit generate -t modules/php-fpm/php-fpm.d/memory-limit.blueprint.conf -o modules/php-fpm/php-fpm.d/memory-limit.conf -e Config,config/.env
- orbit generate -t modules/php-fpm/php-fpm.d/security.blueprint.conf -o modules/php-fpm/php-fpm.d/security.conf -e Config,config/.env
- orbit generate -t modules/php-fpm/Dockerfile.blueprint -o modules/php-fpm/Dockerfile -v Modules,config/modules.yml -e Config,config/.env
- orbit generate -t modules/php-fpm/docker-compose.blueprint.yml -o modules/php-fpm/docker-compose.yml -v Project,config/project.yml;Modules,config/modules.yml -e Config,config/.env {{ if debug }}-d{{ end }}
- orbit run script-fix-permissions-php-fpm -c config/orbit/orbit-scripts.yml -v Project,config/project.yml;Modules,config/modules.yml -e Config,config/.env {{ if debug }}-d{{ end }}
- orbit generate -t modules/php-fpm/conf.d/memory-limit.blueprint.ini -o modules/php-fpm/conf.d/memory-limit.ini -e Config,config/.env {{ if debug }}-d{{ end }}
- orbit generate -t modules/php-fpm/php-fpm.d/memory-limit.blueprint.conf -o modules/php-fpm/php-fpm.d/memory-limit.conf -e Config,config/.env {{ if debug }}-d{{ end }}
- orbit generate -t modules/php-fpm/php-fpm.d/security.blueprint.conf -o modules/php-fpm/php-fpm.d/security.conf -e Config,config/.env {{ if debug }}-d{{ end }}
- orbit generate -t modules/php-fpm/Dockerfile.blueprint -o modules/php-fpm/Dockerfile -v Modules,config/modules.yml -e Config,config/.env {{ if debug }}-d{{ end }}
- docker-compose -p {{ .EnvFiles.Config.ENV }}{{ .Values.Project.name }} -f modules/php-fpm/docker-compose.yml build

# |--------------------------------------------------------------------------
Expand All @@ -96,10 +96,10 @@ commands:
# | Generates NGINX configuration files and builds the image.
# |

- use: "nginx-build"
- use: nginx-build
run:
- orbit generate -t modules/nginx/docker-compose.blueprint.yml -o modules/nginx/docker-compose.yml -v Project,config/project.yml;Modules,config/modules.yml -e Config,config/.env
- orbit run script-fix-permissions-nginx -c config/orbit/orbit-scripts.yml -v Project,config/project.yml;Modules,config/modules.yml -e Config,config/.env
- orbit generate -t modules/nginx/docker-compose.blueprint.yml -o modules/nginx/docker-compose.yml -v Project,config/project.yml;Modules,config/modules.yml -e Config,config/.env {{ if debug }}-d{{ end }}
- orbit run script-fix-permissions-nginx -c config/orbit/orbit-scripts.yml -v Project,config/project.yml;Modules,config/modules.yml -e Config,config/.env {{ if debug }}-d{{ end }}
- docker-compose -p {{ .EnvFiles.Config.ENV }}{{ .Values.Project.name }} -f modules/nginx/docker-compose.yml build

# |--------------------------------------------------------------------------
Expand All @@ -109,14 +109,14 @@ commands:
# | Generates MySQL configuration files.
# |

- use: "mysql-build"
- use: mysql-build
run:
{{ if eq true .Values.Modules.mysql.enable }}
- orbit generate -t modules/mysql/docker-compose.blueprint.yml -o modules/mysql/docker-compose.yml -v Project,config/project.yml;Modules,config/modules.yml -e Config,config/.env
- orbit generate -t modules/mysql/docker-entrypoint-initdb.d/databases.blueprint.sql -o modules/mysql/docker-entrypoint-initdb.d/databases.sql -v Modules,config/modules.yml -e Config,config/.env
- orbit generate -t modules/mysql/secrets/mysql_password.blueprint.txt -o modules/mysql/secrets/mysql_password.txt -e Config,config/.env
- orbit generate -t modules/mysql/secrets/mysql_root_password.blueprint.txt -o modules/mysql/secrets/mysql_root_password.txt -e Config,config/.env
{{ else if eq "windows" .Os }}
- orbit generate -t modules/mysql/docker-compose.blueprint.yml -o modules/mysql/docker-compose.yml -v Project,config/project.yml;Modules,config/modules.yml -e Config,config/.env {{ if debug }}-d{{ end }}
- orbit generate -t modules/mysql/docker-entrypoint-initdb.d/databases.blueprint.sql -o modules/mysql/docker-entrypoint-initdb.d/databases.sql -v Modules,config/modules.yml -e Config,config/.env {{ if debug }}-d{{ end }}
- orbit generate -t modules/mysql/secrets/mysql_password.blueprint.txt -o modules/mysql/secrets/mysql_password.txt -e Config,config/.env {{ if debug }}-d{{ end }}
- orbit generate -t modules/mysql/secrets/mysql_root_password.blueprint.txt -o modules/mysql/secrets/mysql_root_password.txt -e Config,config/.env {{ if debug }}-d{{ end }}
{{ else if eq "windows" os }}
- cmd.exe /c echo Skipping MySQL configuration files generation ...
{{ else }}
- echo Skipping MySQL configuration files generation ...
Expand All @@ -129,11 +129,11 @@ commands:
# | Generates Redis configuration files.
# |

- use: "redis-build"
- use: redis-build
run:
{{ if eq true .Values.Modules.redis.enable }}
- orbit generate -t modules/redis/docker-compose.blueprint.yml -o modules/redis/docker-compose.yml -v Project,config/project.yml;Modules,config/modules.yml -e Config,config/.env
{{ else if eq "windows" .Os }}
- orbit generate -t modules/redis/docker-compose.blueprint.yml -o modules/redis/docker-compose.yml -v Project,config/project.yml;Modules,config/modules.yml -e Config,config/.env {{ if debug }}-d{{ end }}
{{ else if eq "windows" os }}
- cmd.exe /c echo Skipping Redis configuration files generation ...
{{ else }}
- echo Skipping Redis configuration files generation ...
Expand All @@ -146,11 +146,11 @@ commands:
# | Generates RabbitMQ configuration files.
# |

- use: "rabbitmq-build"
- use: rabbitmq-build
run:
{{ if eq true .Values.Modules.rabbitmq.enable }}
- orbit generate -t modules/rabbitmq/docker-compose.blueprint.yml -o modules/rabbitmq/docker-compose.yml -v Project,config/project.yml;Modules,config/modules.yml -e Config,config/.env
{{ else if eq "windows" .Os }}
- orbit generate -t modules/rabbitmq/docker-compose.blueprint.yml -o modules/rabbitmq/docker-compose.yml -v Project,config/project.yml;Modules,config/modules.yml -e Config,config/.env {{ if debug }}-d{{ end }}
{{ else if eq "windows" os }}
- cmd.exe /c echo Skipping RabbitMQ configuration files generation ...
{{ else }}
- echo Skipping RabbitMQ configuration files generation ...
Expand Down
8 changes: 4 additions & 4 deletions config/orbit/orbit-commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,24 @@ commands:
# | Connects through ash to the PHP-FPM container.
# |

- use: "command-workspace"
- use: command-workspace
run:
- docker exec --user www-data -ti {{ .EnvFiles.Config.ENV }}-{{ .Values.Project.name }}-php-fpm ash

# |--------------------------------------------------------------------------
# | orbit run command-mysql-cli
# |--------------------------------------------------------------------------
# |
# | Opens the MySQL cli as root.
# | Opens the MySQL CLI as root.
# |
# | On environments <> "local", it will ask you the MySQL root password.
# |

- use: "command-mysql-cli"
- use: command-mysql-cli
run:
{{ if eq true .Values.Modules.mysql.enable }}
- docker exec -ti {{ .EnvFiles.Config.ENV }}-{{ .Values.Project.name }}-mysql mysql -uroot -p{{ if eq "local" .EnvFiles.Config.ENV }}{{ .EnvFiles.Config.MYSQL_ROOT_PASSWORD }}{{ end }}
{{ else if eq "windows" .Os }}
{{ else if eq "windows" os }}
- cmd.exe /c echo MySQL is not enable!
{{ else }}
- echo MySQL is not enable!
Expand Down
Loading

0 comments on commit ce1f4a8

Please sign in to comment.