diff --git a/.editorconfig b/.editorconfig index ff6fa56..4a62c51 100644 --- a/.editorconfig +++ b/.editorconfig @@ -19,3 +19,7 @@ indent_size = 2 [*.conf] indent_size = 2 + +[*.rst] +indent_style = space +indent_size = 3 diff --git a/CHANGELOG.md b/CHANGELOG.md index 6204bc1..092f357 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,52 @@ PHP Docker Boilerplate Changelog ================================== -5.1.0 - UPCOMING ----------------- +5.2.0-beta3 - 2017-01-18 +------------------------ +- Reverted changes in docker-compose.development.yml (ports) +- Introducted docker-compose.development-reverse-proxy.yml for reverse proxy usage + +5.2.0-beta2 - 2016-12-06 +------------------------ +- Remove port exposures +- DEV: Redirect all mails to mailcatcher (see environment var POSTFIX_RELAYHOST) +- Add mail-sandbox with roundcube + +5.2.0-beta1 - 2016-10-18 +------------------------ +- Add dinghy/dory support +- Switch to mailhog instead of mailcatcher +- Add phpmyadmin +- Switch to ubuntu 16.04 as default +- docker-compose.yml is now using version 2 +- PHP debugger can now be switched with variable +- Add PostgreSQL 9.5 +- Some minor fixes and cleanups + +5.1.3 - 2016-05-25 +------------------ +- Fix nginx vhost configuration (modular WebDevOps image design) + +5.1.2 - 2016-05-25 +------------------ +- Fix typo in Docker image names (duplicate -dev) + +5.1.1 - 2016-05-24 +------------------ +- Fixed Docker image names in Dockerfile.development +- Updated nginx and apache vhost configuration + +5.1.0 - 2016-05-23 +------------------ +- Add support for new WebDevOps Docker images 0.5.0 and up +- Removed xdebug and blackfire, for xdebug use php-dev, php-apache-dev, php-nginx-dev images + +5.0.2 - 2016-05-09 +------------------ +- Added exit if solr entrypoint is failing inside +- Fix solr storage +- Add `make shell` and `make root` (Makefile targets) +- Refactored backup and restore (solr and mysql, see Makefile) 5.0.0 - 2016-03-07 ------------------ diff --git a/Dockerfile.cloud b/Dockerfile.cloud index 6e4733b..6e82651 100644 --- a/Dockerfile.cloud +++ b/Dockerfile.cloud @@ -3,43 +3,48 @@ #++++++++++++++++++++++++++++++++++++++ # # PHP-Versions: +# 5.6 -> PHP 5.6 official PHP image +# 7.0 -> PHP 7.0 official PHP image +# 7.1 -> PHP 7.1 official PHP image # ubuntu-12.04 -> PHP 5.3 (precise) LTS # ubuntu-14.04 -> PHP 5.5 (trusty) LTS # ubuntu-15.04 -> PHP 5.6 (vivid) # ubuntu-15.10 -> PHP 5.6 (wily) -# ubuntu-16.04 -> PHP 5.6 and 7.0 (xenial) LTS +# ubuntu-16.04 -> PHP 7.0 (xenial) LTS # centos-7 -> PHP 5.4 # debian-7 -> PHP 5.4 (wheezy) # debian-8 -> PHP 5.6 and 7.x (jessie) -# debian-9 -> PHP 5.6 and 7.0 (stretch) +# debian-9 -> PHP 7.0 (stretch) # # Apache: +# webdevops/php-apache:5.6 +# webdevops/php-apache:7.0 +# webdevops/php-apache:7.1 # webdevops/php-apache:ubuntu-12.04 # webdevops/php-apache:ubuntu-14.04 # webdevops/php-apache:ubuntu-15.04 # webdevops/php-apache:ubuntu-15.10 # webdevops/php-apache:ubuntu-16.04 -# webdevops/php-apache:ubuntu-16.04-php7 # webdevops/php-apache:centos-7 # webdevops/php-apache:debian-7 # webdevops/php-apache:debian-8 # webdevops/php-apache:debian-8-php7 # webdevops/php-apache:debian-9 -# webdevops/php-apache:debian-9-php7 # # Nginx: +# webdevops/php-nginx:5.6 +# webdevops/php-nginx:7.0 +# webdevops/php-nginx:7.1 # webdevops/php-nginx:ubuntu-12.04 # webdevops/php-nginx:ubuntu-14.04 # webdevops/php-nginx:ubuntu-15.04 # webdevops/php-nginx:ubuntu-15.10 # webdevops/php-nginx:ubuntu-16.04 -# webdevops/php-nginx:ubuntu-16.04-php7 # webdevops/php-nginx:centos-7 # webdevops/php-nginx:debian-7 # webdevops/php-nginx:debian-8 # webdevops/php-nginx:debian-8-php7 # webdevops/php-nginx:debian-9 -# webdevops/php-nginx:debian-9-php7 # # HHVM: # webdevops/hhvm-apache @@ -47,20 +52,19 @@ # #++++++++++++++++++++++++++++++++++++++ -FROM webdevops/php-apache:ubuntu-14.04 +FROM webdevops/php-apache:ubuntu-16.04 ENV PROVISION_CONTEXT "production" # Deploy scripts/configurations COPY etc/ /opt/docker/etc/ -COPY provision/ /opt/docker/provision/ COPY app/ /app/ -RUN /opt/docker/bin/control.sh provision.role.startup boilerplate-main \ - && /opt/docker/bin/control.sh provision.role.startup boilerplate-deployment \ - && /opt/docker/bin/bootstrap.sh +RUN ln -sf /opt/docker/etc/cron/crontab /etc/cron.d/docker-boilerplate \ + && chmod 0644 /opt/docker/etc/cron/crontab \ + && echo >> /opt/docker/etc/cron/crontab \ + && ln -sf /opt/docker/etc/php/production.ini /opt/docker/etc/php/php.ini # Configure volume/workdir -RUN mkdir -p /app/ WORKDIR /app/ diff --git a/Dockerfile.development b/Dockerfile.development index 380caea..0891744 100644 --- a/Dockerfile.development +++ b/Dockerfile.development @@ -7,39 +7,41 @@ # ubuntu-14.04 -> PHP 5.5 (trusty) LTS # ubuntu-15.04 -> PHP 5.6 (vivid) # ubuntu-15.10 -> PHP 5.6 (wily) -# ubuntu-16.04 -> PHP 5.6 and 7.0 (xenial) LTS +# ubuntu-16.04 -> PHP 7.0 (xenial) LTS # centos-7 -> PHP 5.4 # debian-7 -> PHP 5.4 (wheezy) # debian-8 -> PHP 5.6 and 7.x (jessie) -# debian-9 -> PHP 5.6 and 7.0 (stretch) +# debian-9 -> PHP 7.0 (stretch) # # Apache: -# webdevops/php-apache:ubuntu-12.04 -# webdevops/php-apache:ubuntu-14.04 -# webdevops/php-apache:ubuntu-15.04 -# webdevops/php-apache:ubuntu-15.10 -# webdevops/php-apache:ubuntu-16.04 -# webdevops/php-apache:ubuntu-16.04-php7 -# webdevops/php-apache:centos-7 -# webdevops/php-apache:debian-7 -# webdevops/php-apache:debian-8 -# webdevops/php-apache:debian-8-php7 -# webdevops/php-apache:debian-9 -# webdevops/php-apache:debian-9-php7 +# webdevops/php-apache-dev:5.6 +# webdevops/php-apache-dev:7.0 +# webdevops/php-apache-dev:7.1 +# webdevops/php-apache-dev:ubuntu-12.04 +# webdevops/php-apache-dev:ubuntu-14.04 +# webdevops/php-apache-dev:ubuntu-15.04 +# webdevops/php-apache-dev:ubuntu-15.10 +# webdevops/php-apache-dev:ubuntu-16.04 +# webdevops/php-apache-dev:centos-7 +# webdevops/php-apache-dev:debian-7 +# webdevops/php-apache-dev:debian-8 +# webdevops/php-apache-dev:debian-8-php7 +# webdevops/php-apache-dev:debian-9 # # Nginx: -# webdevops/php-nginx:ubuntu-12.04 -# webdevops/php-nginx:ubuntu-14.04 -# webdevops/php-nginx:ubuntu-15.04 -# webdevops/php-nginx:ubuntu-15.10 -# webdevops/php-nginx:ubuntu-16.04 -# webdevops/php-nginx:ubuntu-16.04-php7 -# webdevops/php-nginx:centos-7 -# webdevops/php-nginx:debian-7 -# webdevops/php-nginx:debian-8 -# webdevops/php-nginx:debian-8-php7 -# webdevops/php-nginx:debian-9 -# webdevops/php-nginx:debian-9-php7 +# webdevops/php-nginx-dev:5.6 +# webdevops/php-nginx-dev:7.0 +# webdevops/php-nginx-dev:7.1 +# webdevops/php-nginx-dev:ubuntu-12.04 +# webdevops/php-nginx-dev:ubuntu-14.04 +# webdevops/php-nginx-dev:ubuntu-15.04 +# webdevops/php-nginx-dev:ubuntu-15.10 +# webdevops/php-nginx-dev:ubuntu-16.04 +# webdevops/php-nginx-dev:centos-7 +# webdevops/php-nginx-dev:debian-7 +# webdevops/php-nginx-dev:debian-8 +# webdevops/php-nginx-dev:debian-8-php7 +# webdevops/php-nginx-dev:debian-9 # # HHVM: # webdevops/hhvm-apache @@ -47,19 +49,17 @@ # #++++++++++++++++++++++++++++++++++++++ -FROM webdevops/php-apache:ubuntu-14.04 +FROM webdevops/php-apache-dev:ubuntu-16.04 ENV PROVISION_CONTEXT "development" # Deploy scripts/configurations COPY etc/ /opt/docker/etc/ -COPY provision/ /opt/docker/provision/ -RUN /opt/docker/bin/control.sh provision.role boilerplate-main \ - && /opt/docker/bin/control.sh provision.role boilerplate-main-development \ - && /opt/docker/bin/control.sh provision.role.startup boilerplate-deployment \ - && /opt/docker/bin/bootstrap.sh +RUN ln -sf /opt/docker/etc/cron/crontab /etc/cron.d/docker-boilerplate \ + && chmod 0644 /opt/docker/etc/cron/crontab \ + && echo >> /opt/docker/etc/cron/crontab \ + && ln -sf /opt/docker/etc/php/development.ini /opt/docker/etc/php/php.ini # Configure volume/workdir -RUN mkdir -p /app/ WORKDIR /app/ diff --git a/Dockerfile.production b/Dockerfile.production index 9af6fb3..9debefc 100644 --- a/Dockerfile.production +++ b/Dockerfile.production @@ -3,43 +3,48 @@ #++++++++++++++++++++++++++++++++++++++ # # PHP-Versions: +# 5.6 -> PHP 5.6 official PHP image +# 7.0 -> PHP 7.0 official PHP image +# 7.1 -> PHP 7.1 official PHP image # ubuntu-12.04 -> PHP 5.3 (precise) LTS # ubuntu-14.04 -> PHP 5.5 (trusty) LTS # ubuntu-15.04 -> PHP 5.6 (vivid) # ubuntu-15.10 -> PHP 5.6 (wily) -# ubuntu-16.04 -> PHP 5.6 and 7.0 (xenial) LTS +# ubuntu-16.04 -> PHP 7.0 (xenial) LTS # centos-7 -> PHP 5.4 # debian-7 -> PHP 5.4 (wheezy) # debian-8 -> PHP 5.6 and 7.x (jessie) -# debian-9 -> PHP 5.6 and 7.0 (stretch) +# debian-9 -> PHP 7.0 (stretch) # # Apache: +# webdevops/php-apache:5.6 +# webdevops/php-apache:7.0 +# webdevops/php-apache:7.1 # webdevops/php-apache:ubuntu-12.04 # webdevops/php-apache:ubuntu-14.04 # webdevops/php-apache:ubuntu-15.04 # webdevops/php-apache:ubuntu-15.10 # webdevops/php-apache:ubuntu-16.04 -# webdevops/php-apache:ubuntu-16.04-php7 # webdevops/php-apache:centos-7 # webdevops/php-apache:debian-7 # webdevops/php-apache:debian-8 # webdevops/php-apache:debian-8-php7 # webdevops/php-apache:debian-9 -# webdevops/php-apache:debian-9-php7 # # Nginx: +# webdevops/php-nginx:5.6 +# webdevops/php-nginx:7.0 +# webdevops/php-nginx:7.1 # webdevops/php-nginx:ubuntu-12.04 # webdevops/php-nginx:ubuntu-14.04 # webdevops/php-nginx:ubuntu-15.04 # webdevops/php-nginx:ubuntu-15.10 # webdevops/php-nginx:ubuntu-16.04 -# webdevops/php-nginx:ubuntu-16.04-php7 # webdevops/php-nginx:centos-7 # webdevops/php-nginx:debian-7 # webdevops/php-nginx:debian-8 # webdevops/php-nginx:debian-8-php7 # webdevops/php-nginx:debian-9 -# webdevops/php-nginx:debian-9-php7 # # HHVM: # webdevops/hhvm-apache @@ -47,18 +52,17 @@ # #++++++++++++++++++++++++++++++++++++++ -FROM webdevops/php-apache:ubuntu-14.04 +FROM webdevops/php-apache:ubuntu-16.04 ENV PROVISION_CONTEXT "production" # Deploy scripts/configurations COPY etc/ /opt/docker/etc/ -COPY provision/ /opt/docker/provision/ -RUN /opt/docker/bin/control.sh provision.role boilerplate-main \ - && /opt/docker/bin/control.sh provision.role.startup boilerplate-deployment \ - && /opt/docker/bin/bootstrap.sh +RUN ln -sf /opt/docker/etc/cron/crontab /etc/cron.d/docker-boilerplate \ + && chmod 0644 /opt/docker/etc/cron/crontab \ + && echo >> /opt/docker/etc/cron/crontab \ + && ln -sf /opt/docker/etc/php/production.ini /opt/docker/etc/php/php.ini # Configure volume/workdir -RUN mkdir -p /app/ WORKDIR /app/ diff --git a/Makefile b/Makefile index 1847647..a3acca4 100644 --- a/Makefile +++ b/Makefile @@ -29,33 +29,30 @@ state: rebuild: docker-compose stop + docker-compose pull docker-compose rm --force app - docker-compose build --no-cache - docker-compose up -d + docker-compose build --no-cache --pull + docker-compose up -d --force-recreate ############################# # MySQL ############################# mysql-backup: - docker-compose run --rm --no-deps app root bash /docker/bin/backup.sh mysql + bash ./bin/backup.sh mysql mysql-restore: - docker-compose run --rm --no-deps app root bash /docker/bin/restore.sh mysql + bash ./bin/restore.sh mysql ############################# # Solr ############################# solr-backup: - docker-compose stop solr - docker-compose run --rm --no-deps app root bash /docker/bin/backup.sh solr - docker-compose start solr + bash ./bin/backup.sh solr solr-restore: - docker-compose stop solr - docker-compose run --rm --no-deps app root bash /docker/bin/restore.sh solr - docker-compose start solr + bash ./bin/restore.sh solr ############################# # General @@ -67,11 +64,13 @@ restore: mysql-restore solr-restore build: bash bin/build.sh -bash: - docker-compose run --rm app bash +bash: shell + +shell: + docker-compose exec --user application app /bin/bash root: - docker-compose run --rm app root + docker-compose exec --user root app /bin/bash ############################# # Argument fix workaround diff --git a/README.md b/README.md old mode 100644 new mode 100755 index b8a54d4..d2f07ae --- a/README.md +++ b/README.md @@ -1,9 +1,7 @@ -# Dockerized PHP web project boilerplate +![PHP Docker Boilerplate](https://static.webdevops.io/php-docker-boilerplate.svg) -[![latest v5.0.0](https://img.shields.io/badge/latest-v5.0.0-green.svg?style=flat)](https://github.com/webdevops/php-docker-boilerplate/releases/tag/5.0.0) +[![latest v5.2.0-beta3](https://img.shields.io/badge/latest-v5.2.0_beta3-green.svg?style=flat)](https://github.com/webdevops/php-docker-boilerplate/releases/tag/5.2.0-beta3) ![License MIT](https://img.shields.io/badge/license-MIT-blue.svg?style=flat) -[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/mblaschke/php-docker-boilerplate.svg)](http://isitmaintained.com/project/mblaschke/php-docker-boilerplate "Average time to resolve an issue") -[![Percentage of issues still open](http://isitmaintained.com/badge/open/mblaschke/php-docker-boilerplate.svg)](http://isitmaintained.com/project/mblaschke/php-docker-boilerplate "Percentage of issues still open") This is an easy customizable docker boilerplate for any PHP-based projects like _Symfony Framework_, _CakePHP_, _Yii_ and many other frameworks or applications. @@ -19,6 +17,7 @@ Supports: - Memcached (disabled) - Mailcatcher (if no mail sandbox is used, eg. [Vagrant Development VM](https://github.com/mblaschke/vagrant-development)) - FTP server (vsftpd) +- PhpMyAdmin - maybe more later... This Docker boilerplate is based on the [Docker best practices](https://docs.docker.com/articles/dockerfile_best-practices/) and doesn't use too much magic. Configuration of each docker container is available in the `docker/` directory - feel free to customize. diff --git a/bin/.config.sh b/bin/.config.sh index 4b4cbcf..b393a9a 100755 --- a/bin/.config.sh +++ b/bin/.config.sh @@ -52,3 +52,26 @@ execInDir() { sh -c "cd \"$1\" && $2" } + +dockerContainerId() { + echo "$(docker-compose ps -q "$1" 2> /dev/null || echo "")" +} + +dockerExec() { + docker exec -i "$(docker-compose ps -q app)" "$@" +} + +dockerExecMySQL() { + docker exec -i "$(docker-compose ps -q mysql)" "$@" +} + +dockerCopyFrom() { + PATH_DOCKER="$1" + PATH_HOST="$2" + docker cp "$(docker-compose ps -q app):${PATH_DOCKER}" "${PATH_HOST}" +} +dockerCopyTo() { + PATH_HOST="$1" + PATH_DOCKER="$2" + docker cp "${PATH_HOST}" "$(docker-compose ps -q app):${PATH_DOCKER}" +} diff --git a/bin/backup.sh b/bin/backup.sh index 9d5c3c0..002f857 100755 --- a/bin/backup.sh +++ b/bin/backup.sh @@ -19,27 +19,39 @@ case "$1" in ## MySQL ################################### "mysql") - if [ -f "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" ]; then - logMsg "Removing old backup file..." - rm -f -- "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" + if [[ -n "$(dockerContainerId mysql)" ]]; then + if [ -f "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" ]; then + logMsg "Removing old backup file..." + rm -f -- "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" + fi + + logMsg "Starting MySQL backup..." + MYSQL_ROOT_PASSWORD=$(dockerExecMySQL printenv MYSQL_ROOT_PASSWORD) + dockerExecMySQL sh -c "MYSQL_PWD=\"${MYSQL_ROOT_PASSWORD}\" mysqldump -h mysql -uroot --opt --single-transaction --events --all-databases --routines --comments" | bzip2 > "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" + logMsg "Finished" + else + echo " * Skipping mysql backup, no such container" fi - - logMsg "Starting MySQL backup..." - mysqldump --opt --single-transaction --events --all-databases --routines --comments | bzip2 > "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" - logMsg "Finished" ;; ################################### ## Solr ################################### "solr") - if [ -f "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" ]; then - logMsg "Removing old backup file..." - rm -f -- "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" + if [[ -n "$(dockerContainerId solr)" ]]; then + logMsg "Starting Solr backup..." + docker-compose stop solr + + if [ -f "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" ]; then + logMsg "Removing old backup file..." + rm -f -- "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" + fi + dockerExec tar -cP --to-stdout /storage/solr/ | bzip2 > "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" + + docker-compose start solr + logMsg "Finished" + else + echo " * Skipping solr backup, no such container" fi - - logMsg "Starting Solr backup..." - tar jcPf "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" /storage/solr/ - logMsg "Finished" ;; esac diff --git a/bin/build.sh b/bin/build.sh index 0e7c7bf..9992a7e 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -20,7 +20,7 @@ sectionHeader "Checking for composer.json ..." find "$CODE_DIR" -type f -name 'composer.json' | excludeFilter | while read FILE; do COMPOSER_JSON_DIR=$(dirname $($READLINK -f "$FILE")) - execInDir "$COMPOSER_JSON_DIR" "composer install --no-dev --no-interaction" + execInDir "$COMPOSER_JSON_DIR" "docker run --rm --env COMPOSER_CACHE_DIR=/tmp --user $(id -u):$(id -g) -v \$(pwd):/app composer/composer:alpine install --no-dev --no-interaction" done diff --git a/bin/create-project.sh b/bin/create-project.sh index e350975..43e4194 100755 --- a/bin/create-project.sh +++ b/bin/create-project.sh @@ -8,10 +8,13 @@ set -o errexit ## set -e : exit the script if any statement returns a non-true source "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/.config.sh" if [ "$#" -lt 1 ]; then - echo "No project type defined (either cms, neos, symfony or git)" + echo "No project type defined (either symfony or git)" exit 1 fi +#if app dir exists then backup it with timestamp +[ ! -d "$CODE_DIR" ] || mv "$CODE_DIR" "$CODE_DIR".$(date +%Y%m%d%H%M%S); + mkdir -p -- "$CODE_DIR/" chmod 777 "$CODE_DIR/" @@ -22,9 +25,13 @@ case "$1" in ## SYMFONY ################################### "symfony") - curl -LsS http://symfony.com/installer > /tmp/symfony.$$.phar - execInDir "$CODE_DIR" "php /tmp/symfony.$$.phar new '$CODE_DIR'" - rm -f -- /tmp/symfony.$$.phar + if command -v symfony >/dev/null 2>&1; then + execInDir "$CODE_DIR" "symfony new '$CODE_DIR'" + else + wget https://get.symfony.com/cli/installer -O - | bash + export PATH="$HOME/.symfony/bin:$PATH" + execInDir "$CODE_DIR" "symfony new '$CODE_DIR'" + fi ;; ################################### @@ -39,4 +46,4 @@ case "$1" in ;; esac -touch -- "$CODE_DIR/.gitkeep" \ No newline at end of file +touch -- "$CODE_DIR/.gitkeep" diff --git a/bin/restore.sh b/bin/restore.sh index 71de559..3d581c8 100755 --- a/bin/restore.sh +++ b/bin/restore.sh @@ -19,13 +19,19 @@ case "$1" in ## MySQL ################################### "mysql") - if [ -f "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" ]; then - logMsg "Starting MySQL restore..." - bzcat "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" | mysql - logMsg "Finished" + if [[ -n "$(dockerContainerId mysql)" ]]; then + if [ -f "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" ]; then + logMsg "Starting MySQL restore..." + MYSQL_ROOT_PASSWORD=$(dockerExecMySQL printenv MYSQL_ROOT_PASSWORD) + bzcat "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" | dockerExecMySQL sh -c "MYSQL_PWD=\"${MYSQL_ROOT_PASSWORD}\" mysql -h mysql -uroot" + echo "FLUSH PRIVILEGES;" | dockerExecMySQL sh -c "MYSQL_PWD=\"${MYSQL_ROOT_PASSWORD}\" mysql -h mysql -uroot" + logMsg "Finished" + else + errorMsg "MySQL backup file not found" + exit 1 + fi else - errorMsg "MySQL backup file not found" - exit 1 + echo " * Skipping mysql restore, no such container" fi ;; @@ -33,15 +39,25 @@ case "$1" in ## Solr ################################### "solr") - if [ -f "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" ]; then - logMsg "Starting Solr restore..." - rm -rf /storage/solr/* && mkdir -p /storage/solr/ - chmod 777 /storage/solr/ - tar jxPf "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" -C / - logMsg "Finished" + if [[ -n "$(dockerContainerId solr)" ]]; then + if [ -f "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" ]; then + logMsg "Starting Solr restore..." + docker-compose stop solr + + dockerExec rm -rf /storage/solr/ + dockerExec mkdir -p /storage/solr/ + dockerExec chmod 777 /storage/solr/ + dockerCopyTo "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" "/tmp/solr-restore.tbz2" + dockerExec tar -jxPf "/tmp/solr-restore.tbz2" -C / + + docker-compose start solr + logMsg "Finished" + else + errorMsg "Solr backup file not found" + exit 1 + fi else - errorMsg "Solr backup file not found" - exit 1 + echo " * Skipping solr restore, no such container" fi ;; esac diff --git a/docker-compose.cloud.yml b/docker-compose.cloud.yml index dd05fb1..d01ef63 100644 --- a/docker-compose.cloud.yml +++ b/docker-compose.cloud.yml @@ -1,136 +1,141 @@ -####################################### -# PHP application Docker container -# -# for this container you have to remove -# following entries from .dockerignore: -# -# etc/* -# provision/* -# app/* -# -####################################### -app: - build: . - dockerfile: Dockerfile.cloud - links: - - mysql - #- postgres - #- mail - #- solr - #- elasticsearch - #- redis - #- memcached - #- ftp - ports: - - "8000:80" - - "8443:443" - - "10022:22" - volumes_from: - - storage - env_file: - - etc/environment.yml - - etc/environment.production.yml +version: '2' +services: + ####################################### + # PHP application Docker container + # + # for this container you have to remove + # following entries from .dockerignore: + # + # etc/* + # provision/* + # app/* + # + ####################################### + app: + build: + context: . + dockerfile: Dockerfile.cloud + links: + - mysql + #- postgres + #- mail + #- solr + #- elasticsearch + #- redis + #- memcached + #- ftp + ports: + - "8000:80" + - "8443:443" + - "10022:22" + volumes_from: + - storage + env_file: + - etc/environment.yml + - etc/environment.production.yml -####################################### -# MySQL server -####################################### -mysql: - build: docker/mysql - #dockerfile: MySQL-5.5 - dockerfile: MySQL-5.6 - #dockerfile: MySQL-5.7 - #dockerfile: MariaDB-5.5 - #dockerfile: MariaDB-10 - #dockerfile: Percona-5.5 - #dockerfile: Percona-5.6 - volumes_from: - - storage - env_file: - - etc/environment.yml - - etc/environment.production.yml + ####################################### + # MySQL server + ####################################### + mysql: + build: + context: docker/mysql/ + #dockerfile: MySQL-5.5.Dockerfile + dockerfile: MySQL-5.6.Dockerfile + #dockerfile: MySQL-5.7.Dockerfile + #dockerfile: MariaDB-5.5.Dockerfile + #dockerfile: MariaDB-10.Dockerfile + #dockerfile: Percona-5.5.Dockerfile + #dockerfile: Percona-5.6.Dockerfile + #dockerfile: Percona-5.7.Dockerfile + volumes_from: + - storage + env_file: + - etc/environment.yml + - etc/environment.production.yml -####################################### -# PostgreSQL server -####################################### -#postgres: -# build: docker/postgres/ -# volumes_from: -# - storage -# env_file: -# - etc/environment.yml -# - etc/environment.production.yml + ####################################### + # PostgreSQL server + ####################################### + #postgres: + # build: + # context: docker/postgres/ + # dockerfile: Postgres-9.4.Dockerfile + # dockerfile: Postgres-9.5.Dockerfile + # volumes_from: + # - storage + # env_file: + # - etc/environment.yml + # - etc/environment.production.yml -####################################### -# Solr server -####################################### -#solr: -# build: docker/solr/ -# volumes_from: -# - storage -# environment: -# - SOLR_STORAGE=/storage/solr/server-master/ -# env_file: -# - etc/environment.yml -# - etc/environment.production.yml + ####################################### + # Solr server + ####################################### + #solr: + # build: + # context: docker/solr/ + # volumes_from: + # - storage + # environment: + # - SOLR_STORAGE=/storage/solr/server-master/ + # env_file: + # - etc/environment.yml + # - etc/environment.production.yml -####################################### -# Elasticsearch -####################################### -#elasticsearch: -# build: docker/elasticsearch/ -# volumes_from: -# - storage -# env_file: -# - etc/environment.yml -# - etc/environment.production.yml + ####################################### + # Elasticsearch + ####################################### + #elasticsearch: + # build: + # context: docker/elasticsearch/ + # volumes_from: + # - storage + # env_file: + # - etc/environment.yml + # - etc/environment.production.yml -####################################### -# Redis -####################################### -#redis: -# build: docker/redis/ -# volumes_from: -# - storage -# env_file: -# - etc/environment.yml -# - etc/environment.production.yml + ####################################### + # Redis + ####################################### + #redis: + # build: + # context: docker/redis/ + # volumes_from: + # - storage + # env_file: + # - etc/environment.yml + # - etc/environment.production.yml -####################################### -# Memcached -####################################### -#memcached: -# build: docker/memcached/ -# volumes_from: -# - storage -# env_file: -# - etc/environment.yml -# - etc/environment.production.yml + ####################################### + # Memcached + ####################################### + #memcached: + # build: + # context: docker/memcached/ + # volumes_from: + # - storage + # env_file: + # - etc/environment.yml + # - etc/environment.production.yml -####################################### -# Mailcatcher -####################################### -#mail: -# build: docker/mail/ -# env_file: -# - etc/environment.yml -# - etc/environment.production.yml + ####################################### + # FTP (vsftpd) + ####################################### + #ftp: + # build: + # context: docker/vsftpd/ + # volumes_from: + # - sourcecode + # - storage + # env_file: + # - etc/environment.yml + # - etc/environment.production.yml -####################################### -# FTP (vsftpd) -####################################### -#ftp: -# build: docker/vsftpd/ -# volumes_from: -# - sourcecode -# - storage -# env_file: -# - etc/environment.yml -# - etc/environment.production.yml - -####################################### -# Storage -####################################### -storage: - build: docker/storage/ - volumes: - - /data + ####################################### + # Storage + ####################################### + storage: + build: + context: docker/storage/ + volumes: + - /storage diff --git a/docker-compose.development-reverse-proxy.yml b/docker-compose.development-reverse-proxy.yml new file mode 100755 index 0000000..6ca77b8 --- /dev/null +++ b/docker-compose.development-reverse-proxy.yml @@ -0,0 +1,192 @@ +version: '2' +services: + ####################################### + # PHP application Docker container + ####################################### + app: + build: + context: . + dockerfile: Dockerfile.development + links: + - mail + - mysql + #- postgres + #- solr + #- elasticsearch + #- redis + #- memcached + #- ftp + #ports: + # - "8000:80" + # - "8443:443" + # - "10022:22" + volumes: + - ./app/:/app/ + - ./:/docker/ + # cap and privileged needed for slowlog + cap_add: + - SYS_PTRACE + privileged: true + env_file: + - etc/environment.yml + - etc/environment.development.yml + environment: + - VIRTUAL_HOST=.app.boilerplate.docker + - VIRTUAL_PORT=80 + - POSTFIX_RELAYHOST=[mail]:1025 + + + ####################################### + # MySQL server + ####################################### + mysql: + build: + context: docker/mysql/ + #dockerfile: MySQL-5.5.Dockerfile + dockerfile: MySQL-5.6.Dockerfile + #dockerfile: MySQL-5.7.Dockerfile + #dockerfile: MariaDB-5.5.Dockerfile + #dockerfile: MariaDB-10.Dockerfile + #dockerfile: Percona-5.5.Dockerfile + #dockerfile: Percona-5.6.Dockerfile + #dockerfile: Percona-5.7.Dockerfile + #ports: + # - 13306:3306 + volumes: + - mysql:/var/lib/mysql + env_file: + - etc/environment.yml + - etc/environment.development.yml + + ####################################### + # PostgreSQL server + ####################################### + #postgres: + # build: + # context: docker/postgres/ + # dockerfile: Postgres-9.4.Dockerfile + # dockerfile: Postgres-9.5.Dockerfile + # ports: + # - 15432:5432 + # volumes: + # - postgres:/var/lib/postgresql/data + # env_file: + # - etc/environment.yml + # - etc/environment.development.yml + + ####################################### + # Solr server + ####################################### + #solr: + # build: + # context: docker/solr/ + # volumes: + # - solr:/opt/solr/server/solr/data + # env_file: + # - etc/environment.yml + # - etc/environment.development.yml + # environment: + # - SOLR_STORAGE=/opt/solr/server/solr/data + # - VIRTUAL_HOST=solr.boilerplate.docker + # - VIRTUAL_PORT=8983 + + ####################################### + # Elasticsearch + ####################################### + #elasticsearch: + # build: + # context: docker/elasticsearch/ + # ports: + # - 19200:9200 + # - 19300:9300 + # volumes: + # - elasticsearch:/usr/share/elasticsearch/data + # env_file: + # - etc/environment.yml + # - etc/environment.development.yml + # environment: + # - VIRTUAL_HOST=elasticsearch.boilerplate.docker + # - VIRTUAL_PORT=9200 + + ####################################### + # Redis + ####################################### + #redis: + # build: + # context: docker/redis/ + # volumes: + # - redis:/data + # env_file: + # - etc/environment.yml + # - etc/environment.development.yml + + ####################################### + # Memcached + ####################################### + #memcached: + # build: + # context: docker/memcached/ + # env_file: + # - etc/environment.yml + # - etc/environment.development.yml + + ####################################### + # Mail + ####################################### + # Mailhog + mail: + image: mailhog/mailhog + # ports: + # - 8025:8025 + environment: + - VIRTUAL_HOST=mail.boilerplate.docker + - VIRTUAL_PORT=8025 + + # Mailcatcher + #mail: + # image: schickling/mailcatcher + # environment: + # - VIRTUAL_HOST=mail.boilerplate.docker + # - VIRTUAL_PORT=1080 + + + # Mailsandbox + #mail: + # image: webdevops/mail-sandbox + # environment: + # - VIRTUAL_HOST=mail.boilerplate.docker + # - VIRTUAL_PORT=80 + + ####################################### + # FTP (vsftpd) + ####################################### + #ftp: + # build: + # context: docker/vsftpd/ + # volumes: + # - ./:/application/ + # env_file: + # - etc/environment.yml + # - etc/environment.development.yml + + ####################################### + # phpMyAdmin + ####################################### + #phpmyadmin: + # image: phpmyadmin/phpmyadmin + # links: + # - mysql + # environment: + # - PMA_HOSTS=mysql + # - VIRTUAL_HOST=pma.boilerplate.docker + # - VIRTUAL_PORT=80 + # volumes: + # - phpmyadmin:/sessions + +volumes: + mysql: + postgres: + solr: + elasticsearch: + redis: + phpmyadmin: diff --git a/docker-compose.development.yml b/docker-compose.development.yml old mode 100644 new mode 100755 index 8fc0258..9978c35 --- a/docker-compose.development.yml +++ b/docker-compose.development.yml @@ -1,150 +1,201 @@ -####################################### -# PHP application Docker container -####################################### -app: - build: . - dockerfile: Dockerfile.development - links: - - mysql - #- postgres - #- mail - #- solr - #- elasticsearch - #- redis - #- memcached - #- ftp - ports: - - "8000:80" - - "8443:443" - - "10022:22" - volumes: - - ./app/:/app/ - - /tmp/debug/:/tmp/debug/ - - ./:/docker/ - volumes_from: - - storage - # cap and privileged needed for slowlog - cap_add: - - SYS_PTRACE - privileged: true - env_file: - - etc/environment.yml - - etc/environment.development.yml +version: '2' +services: + ####################################### + # PHP application Docker container + ####################################### + app: + build: + context: . + dockerfile: Dockerfile.development + links: + - mail + - mysql + #- postgres + #- solr + #- elasticsearch + #- redis + #- memcached + #- ftp + ports: + - "8000:80" + - "8443:443" + - "10022:22" + volumes: + - ./app/:/app/ + - ./:/docker/ + # cap and privileged needed for slowlog + cap_add: + - SYS_PTRACE + privileged: true + env_file: + - etc/environment.yml + - etc/environment.development.yml + environment: + - VIRTUAL_HOST=.app.boilerplate.docker + - VIRTUAL_PORT=80 + - POSTFIX_RELAYHOST=[mail]:1025 -####################################### -# MySQL server -####################################### -mysql: - build: docker/mysql - dockerfile: MySQL-5.5 - #dockerfile: MySQL-5.6 - #dockerfile: MySQL-5.7 - #dockerfile: MariaDB-5.5 - #dockerfile: MariaDB-10 - #dockerfile: Percona-5.5 - #dockerfile: Percona-5.6 - ports: - - 13306:3306 - volumes_from: - - storage - volumes: - - /tmp/debug/:/tmp/debug/ - env_file: - - etc/environment.yml - - etc/environment.development.yml -####################################### -# PostgreSQL server -####################################### -#postgres: -# build: docker/postgres/ -# ports: -# - 15432:5432 -# volumes_from: -# - storage -# env_file: -# - etc/environment.yml -# - etc/environment.development.yml + ####################################### + # MySQL server + ####################################### + mysql: + build: + context: docker/mysql/ + #dockerfile: MySQL-5.5.Dockerfile + dockerfile: MySQL-5.6.Dockerfile + #dockerfile: MySQL-5.7.Dockerfile + #dockerfile: MariaDB-5.5.Dockerfile + #dockerfile: MariaDB-10.Dockerfile + #dockerfile: Percona-5.5.Dockerfile + #dockerfile: Percona-5.6.Dockerfile + #dockerfile: Percona-5.7.Dockerfile + ports: + - 13306:3306 + volumes: + - mysql:/var/lib/mysql + env_file: + - etc/environment.yml + - etc/environment.development.yml -####################################### -# Solr server -####################################### -#solr: -# build: docker/solr/ -# ports: -# - 18983:8983 -# volumes_from: -# - storage -# environment: -# - SOLR_STORAGE=/storage/solr/server-master/ -# env_file: -# - etc/environment.yml -# - etc/environment.development.yml + ####################################### + # PostgreSQL server + ####################################### + #postgres: + # build: + # context: docker/postgres/ + # dockerfile: Postgres-9.4.Dockerfile + # dockerfile: Postgres-9.5.Dockerfile + # ports: + # - 15432:5432 + # volumes: + # - postgres:/var/lib/postgresql/data + # env_file: + # - etc/environment.yml + # - etc/environment.development.yml -####################################### -# Elasticsearch -####################################### -#elasticsearch: -# build: docker/elasticsearch/ -# ports: -# - 19200:9200 -# - 19300:9300 -# volumes_from: -# - storage -# env_file: -# - etc/environment.yml -# - etc/environment.development.yml + ####################################### + # Solr server + ####################################### + #solr: + # build: + # context: docker/solr/ + # volumes: + # - solr:/opt/solr/server/solr/data + # env_file: + # - etc/environment.yml + # - etc/environment.development.yml + # environment: + # - SOLR_STORAGE=/opt/solr/server/solr/data + # - VIRTUAL_HOST=solr.boilerplate.docker + # - VIRTUAL_PORT=8983 -####################################### -# Redis -####################################### -#redis: -# build: docker/redis/ -# volumes_from: -# - storage -# env_file: -# - etc/environment.yml -# - etc/environment.development.yml + ####################################### + # Tika server + ####################################### + #tika: + # build: + # context: docker/tika/ + # ports: + # - 19998:9998 -####################################### -# Memcached -####################################### -#memcached: -# build: docker/memcached/ -# volumes_from: -# - storage -# env_file: -# - etc/environment.yml -# - etc/environment.development.yml + ####################################### + # Elasticsearch + ####################################### + #elasticsearch: + # build: + # context: docker/elasticsearch/ + # ports: + # - 19200:9200 + # - 19300:9300 + # volumes: + # - elasticsearch:/usr/share/elasticsearch/data + # env_file: + # - etc/environment.yml + # - etc/environment.development.yml + # environment: + # - VIRTUAL_HOST=elasticsearch.boilerplate.docker + # - VIRTUAL_PORT=9200 -####################################### -# Mailcatcher -####################################### -#mail: -# build: docker/mail/ -# ports: -# - 1080:1080 -# env_file: -# - etc/environment.yml -# - etc/environment.development.yml + ####################################### + # Redis + ####################################### + #redis: + # build: + # context: docker/redis/ + # volumes: + # - redis:/data + # env_file: + # - etc/environment.yml + # - etc/environment.development.yml -####################################### -# FTP (vsftpd) -####################################### -#ftp: -# build: docker/vsftpd/ -# volumes_from: -# - storage -# volumes: -# - ./:/application/ -# env_file: -# - etc/environment.yml -# - etc/environment.development.yml + ####################################### + # Memcached + ####################################### + #memcached: + # build: + # context: docker/memcached/ + # env_file: + # - etc/environment.yml + # - etc/environment.development.yml -####################################### -# Storage -####################################### -storage: - build: docker/storage/ - volumes: - - /data + ####################################### + # Mail + ####################################### + # Mailhog + mail: + image: mailhog/mailhog + # ports: + # - 8025:8025 + environment: + - VIRTUAL_HOST=mail.boilerplate.docker + - VIRTUAL_PORT=8025 + + # Mailcatcher + #mail: + # image: schickling/mailcatcher + # environment: + # - VIRTUAL_HOST=mail.boilerplate.docker + # - VIRTUAL_PORT=1080 + + + # Mailsandbox + #mail: + # image: webdevops/mail-sandbox + # environment: + # - VIRTUAL_HOST=mail.boilerplate.docker + # - VIRTUAL_PORT=80 + + ####################################### + # FTP (vsftpd) + ####################################### + #ftp: + # build: + # context: docker/vsftpd/ + # volumes: + # - ./:/application/ + # env_file: + # - etc/environment.yml + # - etc/environment.development.yml + + ####################################### + # phpMyAdmin + ####################################### + #phpmyadmin: + # image: phpmyadmin/phpmyadmin + # links: + # - mysql + # environment: + # - PMA_HOSTS=mysql + # - VIRTUAL_HOST=pma.boilerplate.docker + # - VIRTUAL_PORT=80 + # volumes: + # - phpmyadmin:/sessions + +volumes: + mysql: + postgres: + solr: + elasticsearch: + redis: + phpmyadmin: diff --git a/docker-compose.production.yml b/docker-compose.production.yml index abd229f..caedb3f 100644 --- a/docker-compose.production.yml +++ b/docker-compose.production.yml @@ -1,142 +1,136 @@ -####################################### -# PHP application Docker container -####################################### -app: - build: . - dockerfile: Dockerfile.production - links: - - mysql - #- postgres - #- mail - #- solr - #- elasticsearch - #- redis - #- memcached - #- ftp - ports: - - "8000:80" - - "8443:443" - - "10022:22" - volumes: - - ./app/:/app/ - volumes_from: - - storage - env_file: - - etc/environment.yml - - etc/environment.production.yml +version: '2' +services: + ####################################### + # PHP application Docker container + ####################################### + app: + build: + context: . + dockerfile: Dockerfile.production + links: + - mysql + #- postgres + #- mail + #- solr + #- elasticsearch + #- redis + #- memcached + #- ftp + ports: + - "8000:80" + - "8443:443" + - "10022:22" + volumes: + - ./app/:/app/ + env_file: + - etc/environment.yml + - etc/environment.production.yml -####################################### -# MySQL server -####################################### -mysql: - build: docker/mysql - dockerfile: MySQL-5.5 - #dockerfile: MySQL-5.6 - #dockerfile: MySQL-5.7 - #dockerfile: MariaDB-5.5 - #dockerfile: MariaDB-10 - #dockerfile: Percona-5.5 - #dockerfile: Percona-5.6 - volumes_from: - - storage - volumes: - - /tmp/debug/:/tmp/debug/ - env_file: - - etc/environment.yml - - etc/environment.production.yml + ####################################### + # MySQL server + ####################################### + mysql: + build: + context: docker/mysql/ + #dockerfile: MySQL-5.5.Dockerfile + dockerfile: MySQL-5.6.Dockerfile + #dockerfile: MySQL-5.7.Dockerfile + #dockerfile: MariaDB-5.5.Dockerfile + #dockerfile: MariaDB-10.Dockerfile + #dockerfile: Percona-5.5.Dockerfile + #dockerfile: Percona-5.6.Dockerfile + #dockerfile: Percona-5.7.Dockerfile + volumes: + - mysql:/var/lib/mysql + env_file: + - etc/environment.yml + - etc/environment.production.yml -####################################### -# PostgreSQL server -####################################### -#postgres: -# build: docker/postgres/ -# ports: -# - 15432:5432 -# volumes_from: -# - storage -# env_file: -# - etc/environment.yml -# - etc/environment.production.yml + ####################################### + # PostgreSQL server + ####################################### + #postgres: + # build: + # context: docker/postgres/ + # dockerfile: Postgres-9.4.Dockerfile + # dockerfile: Postgres-9.5.Dockerfile + # ports: + # - 15432:5432 + # volumes: + # - solr:/opt/solr/server/solr/data + # env_file: + # - etc/environment.yml + # - etc/environment.production.yml -####################################### -# Solr server -####################################### -#solr: -# build: docker/solr/ -# ports: -# - 18983:8983 -# volumes_from: -# - storage -# environment: -# - SOLR_STORAGE=/storage/solr/server-master/ -# env_file: -# - etc/environment.yml -# - etc/environment.production.yml + ####################################### + # Solr server + ####################################### + #solr: + # build: + # context: docker/solr/ + # ports: + # - 18983:8983 + # volumes: + # - solr:/opt/solr/server/solr/data + # environment: + # - SOLR_STORAGE=/opt/solr/server/solr/data + # env_file: + # - etc/environment.yml + # - etc/environment.production.yml -####################################### -# Elasticsearch -####################################### -#elasticsearch: -# build: docker/elasticsearch/ -# ports: -# - 19200:9200 -# - 19300:9300 -# volumes_from: -# - storage -# env_file: -# - etc/environment.yml -# - etc/environment.production.yml + ####################################### + # Elasticsearch + ####################################### + #elasticsearch: + # build: + # context: docker/elasticsearch/ + # ports: + # - 19200:9200 + # - 19300:9300 + # volumes: + # - elasticsearch:/usr/share/elasticsearch/data + # env_file: + # - etc/environment.yml + # - etc/environment.production.yml -####################################### -# Redis -####################################### -#redis: -# build: docker/redis/ -# volumes_from: -# - storage -# env_file: -# - etc/environment.yml -# - etc/environment.production.yml + ####################################### + # Redis + ####################################### + #redis: + # build: + # context: docker/redis/ + # volumes: + # - redis:/data + # env_file: + # - etc/environment.yml + # - etc/environment.production.yml -####################################### -# Memcached -####################################### -#memcached: -# build: docker/memcached/ -# volumes_from: -# - storage -# env_file: -# - etc/environment.yml -# - etc/environment.production.yml + ####################################### + # Memcached + ####################################### + #memcached: + # build: + # context: docker/memcached/ + # env_file: + # - etc/environment.yml + # - etc/environment.production.yml -####################################### -# Mailcatcher -####################################### -#mail: -# build: docker/mail/ -# ports: -# - 1080:1080 -# env_file: -# - etc/environment.yml -# - etc/environment.production.yml + ####################################### + # FTP (vsftpd) + ####################################### + #ftp: + # build: + # context: docker/vsftpd/ + # volumes: + # - ./:/application/ + # env_file: + # - etc/environment.yml + # - etc/environment.production.yml -####################################### -# FTP (vsftpd) -####################################### -#ftp: -# build: docker/vsftpd/ -# volumes_from: -# - storage -# volumes: -# - ./:/application/ -# env_file: -# - etc/environment.yml -# - etc/environment.production.yml - -####################################### -# Storage -####################################### -storage: - build: docker/storage/ - volumes: - - /data +volumes: + mysql: + postgres: + solr: + elasticsearch: + redis: + phpmyadmin: diff --git a/docker/mail/Dockerfile b/docker/mail/Dockerfile deleted file mode 100644 index 7ad1c26..0000000 --- a/docker/mail/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -#++++++++++++++++++++++++++++++++++++++ -# Mailcatcher Docker container -#++++++++++++++++++++++++++++++++++++++ -# -# Images: -# -# schickling/mailcatcher -# https://hub.docker.com/r/schickling/mailcatcher/ -# -#++++++++++++++++++++++++++++++++++++++ - -FROM schickling/mailcatcher diff --git a/docker/mysql/MariaDB-10 b/docker/mysql/MariaDB-10.Dockerfile similarity index 77% rename from docker/mysql/MariaDB-10 rename to docker/mysql/MariaDB-10.Dockerfile index 04acf07..d2bd3a0 100644 --- a/docker/mysql/MariaDB-10 +++ b/docker/mysql/MariaDB-10.Dockerfile @@ -12,3 +12,5 @@ FROM mariadb:10 ADD conf/mysql-docker.cnf /etc/mysql/conf.d/z99-docker.cnf +RUN chown mysql:mysql /etc/mysql/conf.d/z99-docker.cnf \ + && chmod 0644 /etc/mysql/conf.d/z99-docker.cnf diff --git a/docker/mysql/MariaDB-5.5 b/docker/mysql/MariaDB-5.5.Dockerfile similarity index 77% rename from docker/mysql/MariaDB-5.5 rename to docker/mysql/MariaDB-5.5.Dockerfile index 1faba2d..46a979e 100644 --- a/docker/mysql/MariaDB-5.5 +++ b/docker/mysql/MariaDB-5.5.Dockerfile @@ -12,3 +12,5 @@ FROM mariadb:5.5 ADD conf/mysql-docker.cnf /etc/mysql/conf.d/z99-docker.cnf +RUN chown mysql:mysql /etc/mysql/conf.d/z99-docker.cnf \ + && chmod 0644 /etc/mysql/conf.d/z99-docker.cnf diff --git a/docker/mysql/MySQL-5.5 b/docker/mysql/MySQL-5.5.Dockerfile similarity index 75% rename from docker/mysql/MySQL-5.5 rename to docker/mysql/MySQL-5.5.Dockerfile index 51e255b..0352d0a 100644 --- a/docker/mysql/MySQL-5.5 +++ b/docker/mysql/MySQL-5.5.Dockerfile @@ -12,3 +12,5 @@ FROM mysql:5.5 ADD conf/mysql-docker.cnf /etc/mysql/conf.d/z99-docker.cnf +RUN chown mysql:mysql /etc/mysql/conf.d/z99-docker.cnf \ + && chmod 0644 /etc/mysql/conf.d/z99-docker.cnf diff --git a/docker/mysql/MySQL-5.6 b/docker/mysql/MySQL-5.6.Dockerfile similarity index 75% rename from docker/mysql/MySQL-5.6 rename to docker/mysql/MySQL-5.6.Dockerfile index 070ab11..d52d9d2 100644 --- a/docker/mysql/MySQL-5.6 +++ b/docker/mysql/MySQL-5.6.Dockerfile @@ -12,3 +12,5 @@ FROM mysql:5.6 ADD conf/mysql-docker.cnf /etc/mysql/conf.d/z99-docker.cnf +RUN chown mysql:mysql /etc/mysql/conf.d/z99-docker.cnf \ + && chmod 0644 /etc/mysql/conf.d/z99-docker.cnf diff --git a/docker/mysql/MySQL-5.7 b/docker/mysql/MySQL-5.7.Dockerfile similarity index 75% rename from docker/mysql/MySQL-5.7 rename to docker/mysql/MySQL-5.7.Dockerfile index 9e71576..adaf9d8 100644 --- a/docker/mysql/MySQL-5.7 +++ b/docker/mysql/MySQL-5.7.Dockerfile @@ -12,3 +12,5 @@ FROM mysql:5.7 ADD conf/mysql-docker.cnf /etc/mysql/conf.d/z99-docker.cnf +RUN chown mysql:mysql /etc/mysql/conf.d/z99-docker.cnf \ + && chmod 0644 /etc/mysql/conf.d/z99-docker.cnf diff --git a/docker/mysql/Percona-5.5 b/docker/mysql/Percona-5.5.Dockerfile similarity index 76% rename from docker/mysql/Percona-5.5 rename to docker/mysql/Percona-5.5.Dockerfile index fd8585a..21f426c 100644 --- a/docker/mysql/Percona-5.5 +++ b/docker/mysql/Percona-5.5.Dockerfile @@ -12,3 +12,5 @@ FROM percona:5.5 ADD conf/mysql-docker.cnf /etc/mysql/conf.d/z99-docker.cnf +RUN chown mysql:mysql /etc/mysql/conf.d/z99-docker.cnf \ + && chmod 0644 /etc/mysql/conf.d/z99-docker.cnf diff --git a/docker/mysql/Percona-5.6 b/docker/mysql/Percona-5.6.Dockerfile similarity index 76% rename from docker/mysql/Percona-5.6 rename to docker/mysql/Percona-5.6.Dockerfile index 477708d..7e39497 100644 --- a/docker/mysql/Percona-5.6 +++ b/docker/mysql/Percona-5.6.Dockerfile @@ -12,3 +12,5 @@ FROM percona:5.6 ADD conf/mysql-docker.cnf /etc/mysql/conf.d/z99-docker.cnf +RUN chown mysql:mysql /etc/mysql/conf.d/z99-docker.cnf \ + && chmod 0644 /etc/mysql/conf.d/z99-docker.cnf diff --git a/docker/mysql/Percona-5.7.Dockerfile b/docker/mysql/Percona-5.7.Dockerfile new file mode 100644 index 0000000..c163aaf --- /dev/null +++ b/docker/mysql/Percona-5.7.Dockerfile @@ -0,0 +1,16 @@ +#++++++++++++++++++++++++++++++++++++++ +# MySQL Docker container +#++++++++++++++++++++++++++++++++++++++ +# +# Official images: +# +# percona - PerconaDB (MySQL fork) from Percona +# https://hub.docker.com/r/library/percona/ +# +#++++++++++++++++++++++++++++++++++++++ + +FROM percona:5.7 + +ADD conf/mysql-docker.cnf /etc/mysql/conf.d/z99-docker.cnf +RUN chown mysql:mysql /etc/mysql/conf.d/z99-docker.cnf \ + && chmod 0644 /etc/mysql/conf.d/z99-docker.cnf diff --git a/docker/postgres/Dockerfile b/docker/postgres/Postgres-9.4.Dockerfile similarity index 79% rename from docker/postgres/Dockerfile rename to docker/postgres/Postgres-9.4.Dockerfile index 3bdd7c8..13bd217 100644 --- a/docker/postgres/Dockerfile +++ b/docker/postgres/Postgres-9.4.Dockerfile @@ -5,7 +5,7 @@ # Official images: # # postgres - official PostgreSQL -# https://hub.docker.com/r/library/postgres/ +# https://hub.docker.com/_/postgres/ # #++++++++++++++++++++++++++++++++++++++ diff --git a/docker/postgres/Postgres-9.5.Dockerfile b/docker/postgres/Postgres-9.5.Dockerfile new file mode 100644 index 0000000..feeac5d --- /dev/null +++ b/docker/postgres/Postgres-9.5.Dockerfile @@ -0,0 +1,12 @@ +#++++++++++++++++++++++++++++++++++++++ +# PostgreSQL Docker container +#++++++++++++++++++++++++++++++++++++++ +# +# Official images: +# +# postgres - official PostgreSQL +# https://hub.docker.com/_/postgres/ +# +#++++++++++++++++++++++++++++++++++++++ + +FROM postgres:9.5 diff --git a/docker/solr/Dockerfile b/docker/solr/Dockerfile index 516dd5c..8401c49 100644 --- a/docker/solr/Dockerfile +++ b/docker/solr/Dockerfile @@ -20,18 +20,18 @@ COPY ./conf/ /opt/solr-conf/ RUN curl -sf -o /tmp/solr-typo3-plugin.jar -L http://www.typo3-solr.com/fileadmin/files/solr/solr-typo3-plugin-1.3.0.jar # Init directories -RUN cp -a /opt/solr-conf/* /opt/solr/example/solr/ -RUN mkdir -p /opt/solr/example/solr/typo3cores/data -RUN mkdir -p /opt/solr/example/solr/typo3lib +RUN cp -a /opt/solr-conf/* /opt/solr/example/solr/ \ + && mkdir -p /opt/solr/example/solr/typo3cores/data \ + && mkdir -p /opt/solr/example/solr/typo3lib # Add plugins -RUN mv /tmp/solr-typo3-plugin.jar /opt/solr/example/solr/typo3lib/ -RUN ln -s /opt/solr/contrib /opt/solr/example/solr/contrib +RUN mv /tmp/solr-typo3-plugin.jar /opt/solr/example/solr/typo3lib/ \ + && ln -s /opt/solr/contrib /opt/solr/example/solr/contrib # Fix rights RUN chown solr:solr -R /opt/solr/example/solr/ -VOLUME "/storage" +VOLUME "/opt/solr/server/solr/data" ENTRYPOINT ["/entrypoint.sh"] CMD ["solr"] diff --git a/docker/solr/entrypoint.sh b/docker/solr/entrypoint.sh index 2fbaa14..4f3ec51 100755 --- a/docker/solr/entrypoint.sh +++ b/docker/solr/entrypoint.sh @@ -1,5 +1,9 @@ #!/bin/bash +set -o pipefail # trace ERR through pipes +set -o errtrace # trace ERR through 'time command' and other functions +set -o nounset ## set -u : exit the script if you try to use an uninitialised variable +set -o errexit ## set -e : exit the script if any statement returns a non-true return value ################### # Move storage to storage container @@ -27,4 +31,4 @@ if [ "$1" = 'solr' ]; then exec java -jar start.jar fi -exec "$@" \ No newline at end of file +exec "$@" diff --git a/docker/storage/Dockerfile b/docker/storage/Dockerfile index fafb2b2..b8ef05a 100644 --- a/docker/storage/Dockerfile +++ b/docker/storage/Dockerfile @@ -2,4 +2,9 @@ # Storage Docker container #++++++++++++++++++++++++++++++++++++++ -FROM webdevops/storage +FROM busybox + +RUN mkdir /storage \ + && chmod 1777 /storage + +VOLUME "/storage" diff --git a/docker/tika/Dockerfile b/docker/tika/Dockerfile new file mode 100644 index 0000000..384d995 --- /dev/null +++ b/docker/tika/Dockerfile @@ -0,0 +1 @@ +FROM logicalspark/docker-tikaserver diff --git a/documentation/DOCKER-INFO.md b/documentation/DOCKER-INFO.md old mode 100644 new mode 100755 index 794679b..70b335d --- a/documentation/DOCKER-INFO.md +++ b/documentation/DOCKER-INFO.md @@ -16,6 +16,7 @@ memcached (optional) | Memcached server redis (optional) | Redis server ftps (optional) | FTP server (vsftpd) mailcatcher (optional) | Mailserver with easy web and REST interface for mailing +phpmyadmin (optional) | Tool written in PHP, intended to handle the administration of MySQL over the Web The `app/` directory will be mounted under `/app` inside `app` container. @@ -32,6 +33,7 @@ memcached (optional) | [Memcached](https://registry.hub.docker.com/_/memcac redis (optional) | [Redis](https://registry.hub.docker.com/_/redis/) *official* ftp (optional) | [Ubuntu](https://registry.hub.docker.com/_/ubuntu/) *official* mailcatcher (optional) | [Mailcatcher](https://registry.hub.docker.com/u/schickling/mailcatcher/) from _schickling_ +phpmyadmin (optional) | [PhpMyAdmin](https://hub.docker.com/r/phpmyadmin/phpmyadmin/) *official* ## Makefile diff --git a/documentation/INSTALL.md b/documentation/INSTALL.md index bf9cdb2..3060b5f 100644 --- a/documentation/INSTALL.md +++ b/documentation/INSTALL.md @@ -5,7 +5,7 @@ ## Requirements - GNU/Linux with Docker (recommendation: [Vagrant](https://www.vagrantup.com/downloads.html) VM with Docker or [native Linux with Docker](http://docs.docker.com/linux/step_one/) -- make +- [make](https://en.wikipedia.org/wiki/Make_(software)), [GNU manual for make](https://www.gnu.org/software/make/manual/make.html) - [composer](https://getcomposer.org/) - [docker-compose](https://github.com/docker/compose) diff --git a/documentation/SERVICES.md b/documentation/SERVICES.md old mode 100644 new mode 100755 index 6dbc64f..1782129 --- a/documentation/SERVICES.md +++ b/documentation/SERVICES.md @@ -81,3 +81,13 @@ Ports | 20,21 User | dev (if not changed in env) Password | dev (if not changed in env) Path | /storage/ftp (if not changed in env) + +### PhpMyAdmin + +Setting | Value +------------- | ------------- +Host | phpmyadmin +Ports | 8001 +Log in server | mysql +Username | dev (if not changed in env, see mysql container configuration) +Password | dev (if not changed in env, see mysql container configuration) diff --git a/documentation/docs/Makefile b/documentation/docs/Makefile new file mode 100644 index 0000000..dcf3199 --- /dev/null +++ b/documentation/docs/Makefile @@ -0,0 +1,216 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = +BUILDDIR = _build + +# User-friendly check for sphinx-build +ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) +$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) +endif + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . +# the i18n builder cannot share the environment and doctrees with the others +I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . + +.PHONY: help +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " singlehtml to make a single large HTML file" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " applehelp to make an Apple Help Book" + @echo " devhelp to make HTML files and a Devhelp project" + @echo " epub to make an epub" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " latexpdf to make LaTeX files and run them through pdflatex" + @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" + @echo " text to make text files" + @echo " man to make manual pages" + @echo " texinfo to make Texinfo files" + @echo " info to make Texinfo files and run them through makeinfo" + @echo " gettext to make PO message catalogs" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " xml to make Docutils-native XML files" + @echo " pseudoxml to make pseudoxml-XML files for display purposes" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + @echo " coverage to run coverage check of the documentation (if enabled)" + +.PHONY: clean +clean: + rm -rf $(BUILDDIR)/* + +.PHONY: html +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +.PHONY: dirhtml +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +.PHONY: singlehtml +singlehtml: + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml + @echo + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." + +.PHONY: pickle +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +.PHONY: json +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +.PHONY: htmlhelp +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +.PHONY: qthelp +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/WebDevOpsDocumentation.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/WebDevOpsDocumentation.qhc" + +.PHONY: applehelp +applehelp: + $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp + @echo + @echo "Build finished. The help book is in $(BUILDDIR)/applehelp." + @echo "N.B. You won't be able to view it unless you put it in" \ + "~/Library/Documentation/Help or install it in your application" \ + "bundle." + +.PHONY: devhelp +devhelp: + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp + @echo + @echo "Build finished." + @echo "To view the help file:" + @echo "# mkdir -p $$HOME/.local/share/devhelp/WebDevOpsDocumentation" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/WebDevOpsDocumentation" + @echo "# devhelp" + +.PHONY: epub +epub: + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." + +.PHONY: latex +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make' in that directory to run these through (pdf)latex" \ + "(use \`make latexpdf' here to do that automatically)." + +.PHONY: latexpdf +latexpdf: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through pdflatex..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +.PHONY: latexpdfja +latexpdfja: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through platex and dvipdfmx..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +.PHONY: text +text: + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text + @echo + @echo "Build finished. The text files are in $(BUILDDIR)/text." + +.PHONY: man +man: + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + @echo + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." + +.PHONY: texinfo +texinfo: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo + @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." + @echo "Run \`make' in that directory to run these through makeinfo" \ + "(use \`make info' here to do that automatically)." + +.PHONY: info +info: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo "Running Texinfo files through makeinfo..." + make -C $(BUILDDIR)/texinfo info + @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." + +.PHONY: gettext +gettext: + $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale + @echo + @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." + +.PHONY: changes +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +.PHONY: linkcheck +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +.PHONY: doctest +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." + +.PHONY: coverage +coverage: + $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage + @echo "Testing of coverage in the sources finished, look at the " \ + "results in $(BUILDDIR)/coverage/python.txt." + +.PHONY: xml +xml: + $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml + @echo + @echo "Build finished. The XML files are in $(BUILDDIR)/xml." + +.PHONY: pseudoxml +pseudoxml: + $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml + @echo + @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." diff --git a/documentation/docs/conf.py b/documentation/docs/conf.py new file mode 100644 index 0000000..dacc2c4 --- /dev/null +++ b/documentation/docs/conf.py @@ -0,0 +1,300 @@ +# -*- coding: utf-8 -*- +# +# PHP Docker Boilerplate Documentation build configuration file, created by +# sphinx-quickstart on Sat Mar 19 12:21:05 2016. +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys +import os +from recommonmark.parser import CommonMarkParser + +on_rtd = os.environ.get('READTHEDOCS', None) == 'True' + +if not on_rtd: # only import and set the theme if we're building docs locally + import sphinx_rtd_theme + html_theme = 'sphinx_rtd_theme' + html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] + +html_sidebars = { + '**': ['globaltoc.html'], +} +# otherwise, readthedocs.org uses their theme by default, so no need to specify it + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +#sys.path.insert(0, os.path.abspath('.')) + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +#needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +source_suffix = ['.rst', '.md'] +# source_suffix = '.rst' + +source_parsers = { + '.md': CommonMarkParser, +} + +# The encoding of source files. +#source_encoding = 'utf-8-sig' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = u'PHP Docker Boilerplate Documentation' +copyright = u'2016, Team WebDevOps' +author = u'Team WebDevOps' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +#version = u'0.0.2' +# The full version, including alpha/beta/rc tags. +#release = u'0.0.2' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +#today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ['_build'] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +#default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +#add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +#add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# A list of ignored prefixes for module index sorting. +#modindex_common_prefix = [] + +# If true, keep warnings as "system message" paragraphs in the built documents. +#keep_warnings = False + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = False + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +#html_theme = 'alabaster' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +#html_theme_options = {} + +# Add any paths that contain custom themes here, relative to this directory. +#html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +#html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +#html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +#html_logo = None + +# The name of an image file (relative to this directory) to use as a favicon of +# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +#html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# Add any extra paths that contain custom files (such as robots.txt or +# .htaccess) here, relative to this directory. These files are copied +# directly to the root of the documentation. +#html_extra_path = [] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +#html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} + +# If false, no module index is generated. +#html_domain_indices = True + +# If false, no index is generated. +#html_use_index = True + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, links to the reST sources are added to the pages. +#html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +#html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +#html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = None + +# Language to be used for generating the HTML full-text search index. +# Sphinx supports the following languages: +# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' +# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' +#html_search_language = 'en' + +# A dictionary with options for the search language support, empty by default. +# Now only 'ja' uses this config value +#html_search_options = {'type': 'default'} + +# The name of a javascript file (relative to the configuration directory) that +# implements a search results scorer. If empty, the default will be used. +#html_search_scorer = 'scorer.js' + +# Output file base name for HTML help builder. +htmlhelp_basename = 'PhpDockerBoilerplateDocumentationdoc' + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { +# The paper size ('letterpaper' or 'a4paper'). +#'papersize': 'letterpaper', + +# The font size ('10pt', '11pt' or '12pt'). +#'pointsize': '10pt', + +# Additional stuff for the LaTeX preamble. +#'preamble': '', + +# Latex figure (float) alignment +#'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + (master_doc, 'PhpDockerBoilerplateDocumentation.tex', u'PHP Docker Boilerplate Documentation', + u'Florian Tatzel', 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +#latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = False + +# If true, show page references after internal links. +#latex_show_pagerefs = False + +# If true, show URL addresses after external links. +#latex_show_urls = False + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_domain_indices = True + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + (master_doc, 'phpdockerboilerplatedocumentation', u'PHP Docker Boilerplate Documentation', + [author], 1) +] + +# If true, show URL addresses after external links. +#man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + (master_doc, 'PhpDockerBoilerplateDocumentation', u'PHP Docker Boilerplate Documentation', + author, 'PhpDockerBoilerplateDocumentation', 'One line description of project.', + 'Miscellaneous'), +] + +# Documents to append as an appendix to all manuals. +#texinfo_appendices = [] + +# If false, no module index is generated. +#texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +#texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +#texinfo_no_detailmenu = False diff --git a/documentation/docs/content/components/ansibleRoles/roles.rst b/documentation/docs/content/components/ansibleRoles/roles.rst new file mode 100644 index 0000000..658853b --- /dev/null +++ b/documentation/docs/content/components/ansibleRoles/roles.rst @@ -0,0 +1,5 @@ +=========================== +Ansible Roles Configuration +=========================== + +This section is not done yet! diff --git a/documentation/docs/content/components/dockerCompose.rst b/documentation/docs/content/components/dockerCompose.rst new file mode 100644 index 0000000..f5ee7a8 --- /dev/null +++ b/documentation/docs/content/components/dockerCompose.rst @@ -0,0 +1,5 @@ +==================== +Docker Compose Setup +==================== + +This section is not done yet! diff --git a/documentation/docs/content/components/dockerfiles.rst b/documentation/docs/content/components/dockerfiles.rst new file mode 100644 index 0000000..f6da05b --- /dev/null +++ b/documentation/docs/content/components/dockerfiles.rst @@ -0,0 +1,5 @@ +=========== +Dockerfiles +=========== + +This section is not done yet! diff --git a/documentation/docs/content/components/index.rst b/documentation/docs/content/components/index.rst new file mode 100644 index 0000000..b18d888 --- /dev/null +++ b/documentation/docs/content/components/index.rst @@ -0,0 +1,14 @@ +================= +Project Structure +================= + +This section is not done yet! + + +.. toctree:: + :maxdepth: 1 + + dockerfiles + dockerCompose + scripts + ansibleRoles/roles diff --git a/documentation/docs/content/components/scripts.rst b/documentation/docs/content/components/scripts.rst new file mode 100644 index 0000000..ba856ae --- /dev/null +++ b/documentation/docs/content/components/scripts.rst @@ -0,0 +1,12 @@ +======================== +Scripts and Provisioning +======================== + +This section is not done yet! + +------------- +Ansible Roles +------------- + +This section is not done yet! + diff --git a/documentation/docs/content/contribute/code.rst b/documentation/docs/content/contribute/code.rst new file mode 100644 index 0000000..b558f21 --- /dev/null +++ b/documentation/docs/content/contribute/code.rst @@ -0,0 +1,5 @@ +================= +Contributing Code +================= + +How to contribute Code diff --git a/documentation/docs/content/contribute/documentation.rst b/documentation/docs/content/contribute/documentation.rst new file mode 100644 index 0000000..84a7b91 --- /dev/null +++ b/documentation/docs/content/contribute/documentation.rst @@ -0,0 +1,5 @@ +======================== +Contribute Documentation +======================== + +How to contribute Documentation diff --git a/documentation/docs/content/contribute/index.rst b/documentation/docs/content/contribute/index.rst new file mode 100644 index 0000000..dea2e5f --- /dev/null +++ b/documentation/docs/content/contribute/index.rst @@ -0,0 +1,12 @@ +================= +How to Contribute +================= + +This section is not done yet! + + +.. toctree:: + :maxdepth: 1 + + code + documentation diff --git a/documentation/docs/content/gettingStarted/index.rst b/documentation/docs/content/gettingStarted/index.rst new file mode 100644 index 0000000..38f6a07 --- /dev/null +++ b/documentation/docs/content/gettingStarted/index.rst @@ -0,0 +1,44 @@ +=============== +Getting Started +=============== + +------------ +Requirements +------------ + +* Docker host (eg. Vagrant Docker VM or dinghy) +* Docker compose + +------------ +Installation +------------ + +Clone the boilerplate and link or copy ``docker-compose.development.yml`` + +.. code-block:: bash + + git clone https://github.com/webdevops/php-docker-boilerplate.git project + cd project + cp docker-compose.development.yml docker-compose.yml + +----- +Usage +----- + +Startup containers and run the services: + +.. code-block:: bash + + docker-compose up -d + +------------------------------ +Web access (dinghy http proxy) +------------------------------ + +If you're using dinghy docker](https://github.com/codekitchen/dinghy) you can access the services via + +- Application: http://app.boilerplate.docker/ +- Mailhog: http://mail.boilerplate.docker +- PHPMyAdmin: http://pma.boilerplate.docker +- Solr: http://solr.boilerplate.docker +- Elasticsearch: http://elasticsearch.boilerplate.docker diff --git a/documentation/docs/content/introduction.rst b/documentation/docs/content/introduction.rst new file mode 100644 index 0000000..e9e4a87 --- /dev/null +++ b/documentation/docs/content/introduction.rst @@ -0,0 +1,10 @@ +============ +Introduction +============ + +--------------------------------------- +What is the PHP Docker Boilerplate for? +--------------------------------------- + +This PHP Docker Boilerplate is for an example layout for an PHP application with most common services like MySQL or +Postgres and with a development and production context and settings. diff --git a/documentation/docs/content/usage/dockerCompose.rst b/documentation/docs/content/usage/dockerCompose.rst new file mode 100644 index 0000000..012302e --- /dev/null +++ b/documentation/docs/content/usage/dockerCompose.rst @@ -0,0 +1,7 @@ +============================ +Docker Compose Configuration +============================ + +Inside the `docker-compose.*.yml` files the service layout and links between the layout can be defined. + +For some services also the version can be chosen, eg. `MySQL-5.7.Dockerfile` diff --git a/documentation/docs/content/usage/dockerImages.rst b/documentation/docs/content/usage/dockerImages.rst new file mode 100644 index 0000000..dcda8ad --- /dev/null +++ b/documentation/docs/content/usage/dockerImages.rst @@ -0,0 +1,6 @@ +========================= +Customizing Docker Images +========================= + +The main `Dockerfile.*` for the php application container can be customized as any normal Dockerfile image. + diff --git a/documentation/docs/content/usage/index.rst b/documentation/docs/content/usage/index.rst new file mode 100644 index 0000000..d059bbb --- /dev/null +++ b/documentation/docs/content/usage/index.rst @@ -0,0 +1,12 @@ +===== +Usage +===== + +This section is not done yet! + +.. toctree:: + :maxdepth: 1 + + dockerCompose + dockerImages + vagrantDockerVM diff --git a/documentation/docs/content/usage/vagrantDockerVM.rst b/documentation/docs/content/usage/vagrantDockerVM.rst new file mode 100644 index 0000000..b0e7e7c --- /dev/null +++ b/documentation/docs/content/usage/vagrantDockerVM.rst @@ -0,0 +1,10 @@ +============================== +Synergy with Vagrant Docker VM +============================== + +The [Vagrant Docker VM](https://github.com/webdevops/vagrant-docker-vm) (Ubuntu 16.04) is using +[dinghy docker](https://github.com/codekitchen/dinghy) for providing an automatic and dynamic reverse proxy +which makes easy to start multiple instances of the boilerplate. + +You can also use [dinghy docker](https://github.com/codekitchen/dinghy) standalone if you don't need +an full Linux environment. diff --git a/documentation/docs/index.rst b/documentation/docs/index.rst new file mode 100644 index 0000000..3742049 --- /dev/null +++ b/documentation/docs/index.rst @@ -0,0 +1,30 @@ +.. WebDevOps Documentation documentation master file, created by + sphinx-quickstart on Sat Mar 19 12:21:05 2016. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +:orphan: true + +======== +Overview +======== + +| Welcome to the documentation pages for the WebDevOps PHP Docker Boilerplate. +| +| Here you will find informations about the usage of the PHP Docker Boilerplate, as well as informations about the components we used to compose it. +| This documentation is work in progess and we appeciate every help we can get, so feel free to contribute. +| +| + +.. toctree:: + + Back to Project Overview + content/introduction + +.. toctree:: + :caption: Documentation + + content/gettingStarted/index + content/usage/index + content/components/index + content/contribute/index diff --git a/documentation/docs/make.bat b/documentation/docs/make.bat new file mode 100644 index 0000000..86bd9f2 --- /dev/null +++ b/documentation/docs/make.bat @@ -0,0 +1,263 @@ +@ECHO OFF + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set BUILDDIR=_build +set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . +set I18NSPHINXOPTS=%SPHINXOPTS% . +if NOT "%PAPER%" == "" ( + set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% + set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% +) + +if "%1" == "" goto help + +if "%1" == "help" ( + :help + echo.Please use `make ^` where ^ is one of + echo. html to make standalone HTML files + echo. dirhtml to make HTML files named index.html in directories + echo. singlehtml to make a single large HTML file + echo. pickle to make pickle files + echo. json to make JSON files + echo. htmlhelp to make HTML files and a HTML help project + echo. qthelp to make HTML files and a qthelp project + echo. devhelp to make HTML files and a Devhelp project + echo. epub to make an epub + echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter + echo. text to make text files + echo. man to make manual pages + echo. texinfo to make Texinfo files + echo. gettext to make PO message catalogs + echo. changes to make an overview over all changed/added/deprecated items + echo. xml to make Docutils-native XML files + echo. pseudoxml to make pseudoxml-XML files for display purposes + echo. linkcheck to check all external links for integrity + echo. doctest to run all doctests embedded in the documentation if enabled + echo. coverage to run coverage check of the documentation if enabled + goto end +) + +if "%1" == "clean" ( + for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i + del /q /s %BUILDDIR%\* + goto end +) + + +REM Check if sphinx-build is available and fallback to Python version if any +%SPHINXBUILD% 1>NUL 2>NUL +if errorlevel 9009 goto sphinx_python +goto sphinx_ok + +:sphinx_python + +set SPHINXBUILD=python -m sphinx.__init__ +%SPHINXBUILD% 2> nul +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +:sphinx_ok + + +if "%1" == "html" ( + %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/html. + goto end +) + +if "%1" == "dirhtml" ( + %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. + goto end +) + +if "%1" == "singlehtml" ( + %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. + goto end +) + +if "%1" == "pickle" ( + %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can process the pickle files. + goto end +) + +if "%1" == "json" ( + %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can process the JSON files. + goto end +) + +if "%1" == "htmlhelp" ( + %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can run HTML Help Workshop with the ^ +.hhp project file in %BUILDDIR%/htmlhelp. + goto end +) + +if "%1" == "qthelp" ( + %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can run "qcollectiongenerator" with the ^ +.qhcp project file in %BUILDDIR%/qthelp, like this: + echo.^> qcollectiongenerator %BUILDDIR%\qthelp\WebDevOpsDocumentation.qhcp + echo.To view the help file: + echo.^> assistant -collectionFile %BUILDDIR%\qthelp\WebDevOpsDocumentation.ghc + goto end +) + +if "%1" == "devhelp" ( + %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. + goto end +) + +if "%1" == "epub" ( + %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The epub file is in %BUILDDIR%/epub. + goto end +) + +if "%1" == "latex" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "latexpdf" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + cd %BUILDDIR%/latex + make all-pdf + cd %~dp0 + echo. + echo.Build finished; the PDF files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "latexpdfja" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + cd %BUILDDIR%/latex + make all-pdf-ja + cd %~dp0 + echo. + echo.Build finished; the PDF files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "text" ( + %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The text files are in %BUILDDIR%/text. + goto end +) + +if "%1" == "man" ( + %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The manual pages are in %BUILDDIR%/man. + goto end +) + +if "%1" == "texinfo" ( + %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. + goto end +) + +if "%1" == "gettext" ( + %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The message catalogs are in %BUILDDIR%/locale. + goto end +) + +if "%1" == "changes" ( + %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes + if errorlevel 1 exit /b 1 + echo. + echo.The overview file is in %BUILDDIR%/changes. + goto end +) + +if "%1" == "linkcheck" ( + %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck + if errorlevel 1 exit /b 1 + echo. + echo.Link check complete; look for any errors in the above output ^ +or in %BUILDDIR%/linkcheck/output.txt. + goto end +) + +if "%1" == "doctest" ( + %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest + if errorlevel 1 exit /b 1 + echo. + echo.Testing of doctests in the sources finished, look at the ^ +results in %BUILDDIR%/doctest/output.txt. + goto end +) + +if "%1" == "coverage" ( + %SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage + if errorlevel 1 exit /b 1 + echo. + echo.Testing of coverage in the sources finished, look at the ^ +results in %BUILDDIR%/coverage/python.txt. + goto end +) + +if "%1" == "xml" ( + %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The XML files are in %BUILDDIR%/xml. + goto end +) + +if "%1" == "pseudoxml" ( + %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. + goto end +) + +:end diff --git a/etc/application.development.yml b/etc/application.development.yml deleted file mode 100644 index fe2c56b..0000000 --- a/etc/application.development.yml +++ /dev/null @@ -1,45 +0,0 @@ ---- - -PROVISION: - systemUpdate: false - - install: - phpBlackfire: false - phpXdebug: false - apacheModPagespeed: false - - service: - # set "enabled" or "disabled" to controll startup of services - - { service: "cron", status: "enabled" } - - { service: "dnsmasq", status: "enabled" } - - { service: "postfix", status: "enabled" } - -WEB: - vhost: - - { serverName: "docker.vm", serverAlias: "*.vm" } - -DNS: - domain: - - { domain: ".vm", address: "127.0.0.1" } - -MAIL: - aliases: - - { user: "root", destination: "root@example.com" } - conf: - - { variable: "inet_interfaces", value: "loopback-only" } - # - { variable: "relayhost", value: "foobar" } - -PHP: - fpm: - conf: - # PM - - { variable: "pm.max_children", value: "15" } - - { variable: "pm.start_servers", value: "2" } - - { variable: "pm.min_spare_servers", value: "1" } - - { variable: "pm.max_spare_servers", value: "3" } - # Misc - - { variable: "catch_workers_output", value: "yes" } - # Logs - - { variable: "access.format", value: '"%R - %u %t \"%m %r%Q%q\" %s %f cpu:%C%% mem:%{megabytes}M reqTime:%d"' } - - { variable: "request_slowlog_timeout", value: "10s" } - - { variable: "php_admin_flag[log_errors]", value: "on" } diff --git a/etc/application.environment.yml b/etc/application.environment.yml deleted file mode 100644 index 5de506a..0000000 --- a/etc/application.environment.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- - -DOCKER_ENVIRONMENT: - # Application - TYPO3_CONTEXT: "{{ lookup('env','TYPO3_CONTEXT') }}" - - SYMFONY_ENV: "{{ lookup('env','SYMFONY_ENV') }}" - SYMFONY_DEBUG: "{{ lookup('env','SYMFONY_DEBUG') }}" - - CAKE_ENV: "{{ lookup('env','CAKE_ENV') }}" - - YII_ENVIRONMENT: "{{ lookup('env','YII_ENVIRONMENT') }}" - - # General - CLI_SCRIPT: "{{ lookup('env','CLI_SCRIPT') }}" - MAIL_GATEWAY: "{{ lookup('env','MAIL_GATEWAY') }}" - - # MySQL - MYSQL_ROOT_PASSWORD: "{{ lookup('env','MYSQL_ROOT_PASSWORD') }}" - MYSQL_USER: "{{ lookup('env','MYSQL_USER') }}" - MYSQL_PASSWORD: "{{ lookup('env','MYSQL_PASSWORD') }}" - MYSQL_DATABASE: "{{ lookup('env','MYSQL_DATABASE') }}" - - # Postgres - POSTGRES_USER: "{{ lookup('env','POSTGRES_USER') }}" - POSTGRES_PASSWORD: "{{ lookup('env','POSTGRES_PASSWORD') }}" - - # FTP - FTP_USER: "{{ lookup('env','FTP_USER') }}" - FTP_PASSWORD: "{{ lookup('env','FTP_PASSWORD') }}" - FTP_PATH: "{{ lookup('env','FTP_PATH') }}" diff --git a/etc/application.production.yml b/etc/application.production.yml deleted file mode 100644 index ba8ae21..0000000 --- a/etc/application.production.yml +++ /dev/null @@ -1,45 +0,0 @@ ---- - -PROVISION: - systemUpdate: true - - install: - phpBlackfire: false - phpXdebug: false - apacheModPagespeed: false - - service: - # set "enabled" or "disabled" to controll startup of services - - { service: "cron", status: "disabled" } - - { service: "dnsmasq", status: "enabled" } - - { service: "postfix", status: "enabled" } - -WEB: - vhost: - - { serverName: "docker.vm", serverAlias: "*.vm" } - -DNS: - domain: - - { domain: ".vm", address: "127.0.0.1" } - -MAIL: - aliases: - - { user: "root", destination: "root@example.com" } - conf: - - { variable: "inet_interfaces", value: "loopback-only" } - # - { variable: "relayhost", value: "foobar" } - -PHP: - fpm: - conf: - # PM - - { variable: "pm.max_children", value: "30" } - - { variable: "pm.start_servers", value: "10" } - - { variable: "pm.min_spare_servers", value: "5" } - - { variable: "pm.max_spare_servers", value: "10" } - # Misc - - { variable: "catch_workers_output", value: "yes" } - # Logs - - { variable: "access.format", value: "%R - %u %t \"%m %r%Q%q\" %s %f" } - - { variable: "request_slowlog_timeout", value: "10s" } - - { variable: "php_admin_flag[log_errors]", value: "on" } diff --git a/etc/environment.development.yml b/etc/environment.development.yml index 6ee579a..799762d 100644 --- a/etc/environment.development.yml +++ b/etc/environment.development.yml @@ -6,6 +6,11 @@ # to apply them ####################################### +####################################### +# PHP Debugger (xdebug|blackfire|none) + +PHP_DEBUGGER=xdebug + ####################################### # Context environment @@ -21,3 +26,4 @@ CAKE_ENV=dev # yii YII_ENVIRONMENT=Development + diff --git a/etc/environment.yml b/etc/environment.yml index 818aa92..5e327dd 100644 --- a/etc/environment.yml +++ b/etc/environment.yml @@ -14,6 +14,35 @@ WEB_DOCUMENT_ROOT=/app/ WEB_DOCUMENT_INDEX=index.php CLI_SCRIPT=php /app/index.php +####################################### +# PHP settings +# (available in docker images after 2017-06-15) + +# PHP.ini + +# php.memory_limit=2G +# php.date.timezone=UTC +# php.display_errors=1 +# php.max_execution_time=600 +# php.post_max_size=50M +# php.upload_max_filesize=50M + +# FPM global (master) + +# fpm.global.process_control_timeout=5m +# fpm.global.process.max=100 + +# FPM pool + +# fpm.pool.pm=dynamic +# fpm.pool.pm.max_children=20 +# fpm.pool.pm.start_servers=20 +# fpm.pool.pm.min_spare_servers=1 +# fpm.pool.pm.max_spare_servers=3 +# fpm.pool.pm.process_idle_timeout=10s +# fpm.pool.pm.max_requests=1000 +# fpm.pool.request_terminate_timeout=5m + ####################################### # SSH settings # SSH public key (without comment): @@ -39,6 +68,7 @@ MYSQL_DATABASE=database # PostgreSQL settings POSTGRES_USER=dev POSTGRES_PASSWORD=dev +POSTGRES_DATABASE=dev ####################################### # FTP settings diff --git a/provision/roles/boilerplate-deployment/tasks/main.yml b/provision/roles/boilerplate-deployment/tasks/main.yml deleted file mode 100644 index 2651211..0000000 --- a/provision/roles/boilerplate-deployment/tasks/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- - -# add deployment tasks here \ No newline at end of file diff --git a/provision/roles/boilerplate-main-development/defaults/main.yml b/provision/roles/boilerplate-main-development/defaults/main.yml deleted file mode 100644 index 6b531af..0000000 --- a/provision/roles/boilerplate-main-development/defaults/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- - -PROVISION_CONTEXT: "{{ lookup('env','PROVISION_CONTEXT') }}" diff --git a/provision/roles/boilerplate-main-development/tasks/bootstrap.yml b/provision/roles/boilerplate-main-development/tasks/bootstrap.yml deleted file mode 100644 index f39fcf3..0000000 --- a/provision/roles/boilerplate-main-development/tasks/bootstrap.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- - -- include: bootstrap/php-blackfire/debian.yml - when: ansible_distribution == 'CentOS' and PROVISION.install.phpBlackfire is defined and PROVISION.install.phpBlackfire - -- include: bootstrap/php-blackfire/redhat.yml - when: ansible_os_family == 'Debian' and PROVISION.install.phpBlackfire is defined and PROVISION.install.phpBlackfire - -- include: bootstrap/php.xdebug.yml - when: PROVISION.install.phpXdebug is defined and PROVISION.install.phpXdebug - diff --git a/provision/roles/boilerplate-main-development/tasks/bootstrap/php-blackfire/debian.yml b/provision/roles/boilerplate-main-development/tasks/bootstrap/php-blackfire/debian.yml deleted file mode 100644 index 243bee6..0000000 --- a/provision/roles/boilerplate-main-development/tasks/bootstrap/php-blackfire/debian.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- - -- name: Add blackfire.io key - apt_key: - url: https://packagecloud.io/gpg.key - state: present - -- name: Add blackfire.io repository - apt_repository: - repo: 'deb http://packages.blackfire.io/debian any main' - state: present - update_cache: yes - -- name: Install blackfire-php - apt: - name: '{{ item }}' - state: present - with_items: - - blackfire-php diff --git a/provision/roles/boilerplate-main-development/tasks/bootstrap/php-blackfire/redhat.yml b/provision/roles/boilerplate-main-development/tasks/bootstrap/php-blackfire/redhat.yml deleted file mode 100644 index 56dcc76..0000000 --- a/provision/roles/boilerplate-main-development/tasks/bootstrap/php-blackfire/redhat.yml +++ /dev/null @@ -1,26 +0,0 @@ ---- - -- name: Add blackfire.io key - rpm_key: - key: https://packagecloud.io/gpg.key - state: present - -- name: Add blackfire.io repository - get_url: - url: http://packages.blackfire.io/fedora/blackfire.repo - dest: /etc/yum.repos.d/blackfire.repo - mode: 0644 - -- name: Disable gpg check for blackfire (CentOS 7 workaround) - lineinfile: - dest: /etc/yum.repos.d/blackfire.repo - regexp: '^repo_gpgcheck=1' - line: 'repo_gpgcheck=0' - when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7' - -- name: Install blackfire-php - yum: - name: '{{ item }}' - state: present - with_items: - - blackfire-php diff --git a/provision/roles/boilerplate-main-development/tasks/bootstrap/php.xdebug.yml b/provision/roles/boilerplate-main-development/tasks/bootstrap/php.xdebug.yml deleted file mode 100644 index c4471b4..0000000 --- a/provision/roles/boilerplate-main-development/tasks/bootstrap/php.xdebug.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- - -- name: Set php xdebug file [RedHat family] - set_fact: - php_xdebug_conf: /etc/php.d/xdebug.ini - when: ansible_os_family == 'RedHat' - -- name: Set php xdebug file [Debian family] - set_fact: - php_xdebug_conf: /etc/php5/mods-available/xdebug.ini - when: ansible_os_family == 'Debian' - -- name: Set php xdebug file [Ubuntu 12.04] - set_fact: - php_xdebug_conf: /etc/php5/conf.d/xdebug.ini - when: ansible_distribution == 'Ubuntu' and ansible_distribution_version == "12.04" - -- name: Enable xdebug - replace: - dest: '{{ php_xdebug_conf }}' - regexp: '^[\s]*;[\s]*({{ item }}[\s]*=.*)$' - replace: '\1' - with_items: - - 'zend_extension' - - 'extension' diff --git a/provision/roles/boilerplate-main-development/tasks/main.yml b/provision/roles/boilerplate-main-development/tasks/main.yml deleted file mode 100644 index cdf7f81..0000000 --- a/provision/roles/boilerplate-main-development/tasks/main.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- - -- include: bootstrap.yml - tags: - - bootstrap - when: PROVISION_CONTEXT == "development" diff --git a/provision/roles/boilerplate-main/defaults/main.yml b/provision/roles/boilerplate-main/defaults/main.yml deleted file mode 100644 index 6b531af..0000000 --- a/provision/roles/boilerplate-main/defaults/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- - -PROVISION_CONTEXT: "{{ lookup('env','PROVISION_CONTEXT') }}" diff --git a/provision/roles/boilerplate-main/handlers/main.yml b/provision/roles/boilerplate-main/handlers/main.yml deleted file mode 100644 index 19664dd..0000000 --- a/provision/roles/boilerplate-main/handlers/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- name: update aliases - command: newaliases diff --git a/provision/roles/boilerplate-main/tasks/bootstrap.yml b/provision/roles/boilerplate-main/tasks/bootstrap.yml deleted file mode 100644 index eb3f70a..0000000 --- a/provision/roles/boilerplate-main/tasks/bootstrap.yml +++ /dev/null @@ -1,38 +0,0 @@ ---- -############################# -# Gather environment stuff -############################# - -- include_vars: "/opt/docker/etc/application.{{ PROVISION_CONTEXT }}.yml" - -############################# -# Run tasks -############################# - -- include: bootstrap/systemUpdate.centos.yml - when: PROVISION.systemUpdate is defined and PROVISION.systemUpdate and ansible_distribution == 'CentOS' - -- include: bootstrap/systemUpdate.ubuntu.yml - when: PROVISION.systemUpdate is defined and PROVISION.systemUpdate and ansible_distribution == 'Ubuntu' - -- include: bootstrap/composer.yml - when: PROVISION.install.phpComposer is defined and PROVISION.install.phpComposer - -- include: bootstrap/services.yml - -- include: bootstrap/cron.yml - -- include: bootstrap/dnsmasq.yml - when: DNS is defined - -- include: bootstrap/postfix.yml - when: MAIL is defined - -- include: bootstrap/php.yml - -- include: bootstrap/web.apache.yml - -- include: bootstrap/web.apache.pagespeed.yml - when: PROVISION.install.apacheModPagespeed is defined and PROVISION.install.apacheModPagespeed - -- include: bootstrap/web.nginx.yml diff --git a/provision/roles/boilerplate-main/tasks/bootstrap/composer.yml b/provision/roles/boilerplate-main/tasks/bootstrap/composer.yml deleted file mode 100644 index df8da1e..0000000 --- a/provision/roles/boilerplate-main/tasks/bootstrap/composer.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- - -- stat: path=/usr/local/bin/composer - register: composer_bin - -- name: Update composer (phar) - command: 'composer self-update' - when: composer_bin.stat.exists is defined and composer_bin.stat.exists - ignore_errors: yes - -- name: Install composer (phar) - raw: 'curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer' - when: composer_bin.stat.exists is defined and not composer_bin.stat.exists - diff --git a/provision/roles/boilerplate-main/tasks/bootstrap/cron.yml b/provision/roles/boilerplate-main/tasks/bootstrap/cron.yml deleted file mode 100644 index f757621..0000000 --- a/provision/roles/boilerplate-main/tasks/bootstrap/cron.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- - -- name: Create link for crontab - file: - src: '/opt/docker/etc/cron/crontab' - dest: '/etc/cron.d/docker-boilerplate' - state: link - force: yes - -- name: Add newline to crontab - raw: 'echo >> /opt/docker/etc/crontab' diff --git a/provision/roles/boilerplate-main/tasks/bootstrap/dnsmasq.yml b/provision/roles/boilerplate-main/tasks/bootstrap/dnsmasq.yml deleted file mode 100644 index 4996ec2..0000000 --- a/provision/roles/boilerplate-main/tasks/bootstrap/dnsmasq.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- - -- include_vars: "/opt/docker/etc/application.{{ PROVISION_CONTEXT }}.yml" - -- name: Add domains to dnsmasq - lineinfile: - dest: "/etc/dnsmasq.d/docker" - regexp: '^address=/{{ item.domain }}' - line: 'address=/{{ item.domain }}/{{ item.address }}' - create: yes - with_items: "{{ DNS.domain }}" - when: DNS.domain is defined diff --git a/provision/roles/boilerplate-main/tasks/bootstrap/php.yml b/provision/roles/boilerplate-main/tasks/bootstrap/php.yml deleted file mode 100644 index e0c09b9..0000000 --- a/provision/roles/boilerplate-main/tasks/bootstrap/php.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- - -- include_vars: "/opt/docker/etc/application.{{ PROVISION_CONTEXT }}.yml" - -- name: Configure php-fpm (pool www.conf) - lineinfile: - dest: "/opt/docker/etc/php/fpm/pool.d/application.conf" - regexp: '^[\s;]*{{ item.variable }}[\s]*=' - line: '{{ item.variable }} = {{ item.value }}' - with_items: "{{ PHP.fpm.conf }}" - when: PHP.fpm.conf is defined and item.value != "" - -- name: Configure php-fpm (php-fpm.conf) - lineinfile: - dest: "/opt/docker/etc/php/fpm/php-fpm.conf" - regexp: '^[\s;]*{{ item.key }}[\s]*=' - line: '{{ item.key }} = {{ item.value }}' - with_items: - - { key: 'daemonize', value: 'no' } - -- name: Set development environment php.ini - file: - src: '/opt/docker/etc/php/development.ini' - dest: '/opt/docker/etc/php/php.ini' - state: link - force: yes - when: PROVISION_CONTEXT == "development" - -- name: Enable production environment php.ini - file: - src: '/opt/docker/etc/php/production.ini' - dest: '/opt/docker/etc/php/php.ini' - state: link - force: yes - when: PROVISION_CONTEXT == "production" or PROVISION_CONTEXT == "" diff --git a/provision/roles/boilerplate-main/tasks/bootstrap/postfix.yml b/provision/roles/boilerplate-main/tasks/bootstrap/postfix.yml deleted file mode 100644 index b15abbe..0000000 --- a/provision/roles/boilerplate-main/tasks/bootstrap/postfix.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- - -- name: Configure postfix - lineinfile: - dest: /etc/postfix/main.cf - regexp: '^[\s;]*{{ item.variable }}[\s]*=' - line: '{{ item.variable }} = {{ item.value }}' - with_items: "{{ MAIL.conf }}" - when: MAIL.conf is defined and item.value != "" - -- name: Configure aliases - lineinfile: - dest: /etc/aliases - regexp: '^[\s;]*{{ item.user }}[\s]*:' - line: '{{ item.user }}: {{ item.destination }}' - with_items: "{{ MAIL.aliases }}" - when: MAIL.aliases is defined and item.destination != "" - notify: update aliases diff --git a/provision/roles/boilerplate-main/tasks/bootstrap/services.yml b/provision/roles/boilerplate-main/tasks/bootstrap/services.yml deleted file mode 100644 index 7d9d7df..0000000 --- a/provision/roles/boilerplate-main/tasks/bootstrap/services.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- - -- name: Enable services - command: "/opt/docker/bin/control.sh service.enable {{ item.service }}" - with_items: "{{ PROVISION.service }}" - when: PROVISION.service is defined and item.status == 'enabled' - -- name: Disable services - command: "/opt/docker/bin/control.sh service.disable {{ item.service }}" - with_items: "{{ PROVISION.service }}" - when: PROVISION.service is defined and item.status == 'disabled' diff --git a/provision/roles/boilerplate-main/tasks/bootstrap/systemUpdate.centos.yml b/provision/roles/boilerplate-main/tasks/bootstrap/systemUpdate.centos.yml deleted file mode 100644 index 15f1e0b..0000000 --- a/provision/roles/boilerplate-main/tasks/bootstrap/systemUpdate.centos.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- - -- name: Update system packages (yum) ... will take some time - yum: name=* state=latest diff --git a/provision/roles/boilerplate-main/tasks/bootstrap/systemUpdate.ubuntu.yml b/provision/roles/boilerplate-main/tasks/bootstrap/systemUpdate.ubuntu.yml deleted file mode 100644 index f2270d7..0000000 --- a/provision/roles/boilerplate-main/tasks/bootstrap/systemUpdate.ubuntu.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- - -- name: Upgrade system packages (apt-get dist-upgrade) ... will take some time - apt: - upgrade: dist - update_cache: true diff --git a/provision/roles/boilerplate-main/tasks/bootstrap/web.apache.pagespeed.yml b/provision/roles/boilerplate-main/tasks/bootstrap/web.apache.pagespeed.yml deleted file mode 100644 index 210457a..0000000 --- a/provision/roles/boilerplate-main/tasks/bootstrap/web.apache.pagespeed.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- - -- name: Download apache mod_pagespeed [Debian family] - get_url: - url: https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_amd64.deb - dest: /tmp/mod-pagespeed.deb - when: ansible_os_family == 'Debian' - -- name: Install apache mod_pagespeed [Debian family] - apt: - deb: /tmp/mod-pagespeed.deb - when: ansible_os_family == 'Debian' - -- name: Install apache mod_pagespeed [RedHat family] - yum: - name: https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_x86_64.rpm - state: present - when: ansible_os_family == 'RedHat' diff --git a/provision/roles/boilerplate-main/tasks/bootstrap/web.apache.yml b/provision/roles/boilerplate-main/tasks/bootstrap/web.apache.yml deleted file mode 100644 index a8c806c..0000000 --- a/provision/roles/boilerplate-main/tasks/bootstrap/web.apache.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- - -- file: - path: "/opt/docker/etc/httpd" - state: directory - -- name: Deploy dynamic apache vhost - template: - src: templates/apache/vhost.conf.j2 - dest: /opt/docker/etc/httpd/vhost.conf - owner: root - group: root - mode: 0775 diff --git a/provision/roles/boilerplate-main/tasks/bootstrap/web.nginx.yml b/provision/roles/boilerplate-main/tasks/bootstrap/web.nginx.yml deleted file mode 100644 index de750da..0000000 --- a/provision/roles/boilerplate-main/tasks/bootstrap/web.nginx.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- - -- file: - path: "/opt/docker/etc/nginx" - state: directory - -- name: Deploy dynamic nginx vhost - template: - src: templates/nginx/vhost.conf.j2 - dest: /opt/docker/etc/nginx/vhost.conf - owner: root - group: root - mode: 0775 diff --git a/provision/roles/boilerplate-main/tasks/entrypoint.yml b/provision/roles/boilerplate-main/tasks/entrypoint.yml deleted file mode 100644 index e0224ca..0000000 --- a/provision/roles/boilerplate-main/tasks/entrypoint.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- - -- include: entrypoint/mysql.yml -- include: entrypoint/php.yml diff --git a/provision/roles/boilerplate-main/tasks/entrypoint/mysql.yml b/provision/roles/boilerplate-main/tasks/entrypoint/mysql.yml deleted file mode 100644 index 7072644..0000000 --- a/provision/roles/boilerplate-main/tasks/entrypoint/mysql.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- - -- name: Deploy root my.cnf - template: - src: templates/my.cnf.j2 - dest: /root/.my.cnf - owner: root - group: root - mode: 0644 - -- name: Deploy user my.cnf - template: - src: templates/my.cnf.j2 - dest: /home/.my.cnf - owner: "{{ lookup('env','APPLICATION_USER') }}" - group: "{{ lookup('env','APPLICATION_USER') }}" - mode: 0644 diff --git a/provision/roles/boilerplate-main/tasks/entrypoint/php.yml b/provision/roles/boilerplate-main/tasks/entrypoint/php.yml deleted file mode 100644 index b841d2c..0000000 --- a/provision/roles/boilerplate-main/tasks/entrypoint/php.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- - -- include_vars: "/opt/docker/etc/application.{{ PROVISION_CONTEXT }}.yml" -- include_vars: "/opt/docker/etc/application.environment.yml" - -- name: Configure environment variables from DOCKER_ENVIRONMENT for php-fpm (pool www.conf) - lineinfile: - dest: "/opt/docker/etc/php/fpm/pool.d/application.conf" - regexp: '^env\[{{ item.key }}\][\s]*=' - line: 'env[{{ item.key }}] = "{{ item.value }}"' - with_dict: "{{ DOCKER_ENVIRONMENT }}" - when: DOCKER_ENVIRONMENT is defined and item.value != '' diff --git a/provision/roles/boilerplate-main/tasks/main.yml b/provision/roles/boilerplate-main/tasks/main.yml deleted file mode 100644 index 7895a52..0000000 --- a/provision/roles/boilerplate-main/tasks/main.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- - -- include: bootstrap.yml - tags: - - bootstrap - -- include: entrypoint.yml - tags: - - entrypoint diff --git a/provision/roles/boilerplate-main/templates/apache/vhost.conf.j2 b/provision/roles/boilerplate-main/templates/apache/vhost.conf.j2 deleted file mode 100644 index 28346a8..0000000 --- a/provision/roles/boilerplate-main/templates/apache/vhost.conf.j2 +++ /dev/null @@ -1,28 +0,0 @@ -####################################### -# Vhost -####################################### -{% for vhost in WEB.vhost %} - -# Vhost for "{{ vhost.serverName }}" - - - ServerName "{{ vhost.serverName }}" - ServerAlias "{{ vhost.serverAlias }}" - DocumentRoot "{{ vhost.documentRoot|default('') }}" - - UseCanonicalName Off - - Include /opt/docker/etc/httpd/vhost.common.conf - - - - ServerName "{{ vhost.serverName }}" - ServerAlias "{{ vhost.serverAlias }}" - DocumentRoot "{{ vhost.documentRoot|default('') }}" - - UseCanonicalName Off - Include /opt/docker/etc/httpd/vhost.common.conf - Include /opt/docker/etc/httpd/vhost.ssl.conf - - -{% endfor %} diff --git a/provision/roles/boilerplate-main/templates/my.cnf.j2 b/provision/roles/boilerplate-main/templates/my.cnf.j2 deleted file mode 100644 index dd22c34..0000000 --- a/provision/roles/boilerplate-main/templates/my.cnf.j2 +++ /dev/null @@ -1,21 +0,0 @@ -[client] -host=mysql -user="root" -password="{{ lookup('env','MYSQL_ROOT_PASSWORD') }}" - -[mysql] -host=mysql -user="root" -password="{{ lookup('env','MYSQL_ROOT_PASSWORD') }}" -database="{{ lookup('env','MYSQL_DATABASE') }}" -default-character-set=utf8 -local-infile=1 -show-warnings -auto-rehash -sigint-ignore -reconnect - -[mysqldump] -host=mysql -user="root" -password="{{ lookup('env','MYSQL_ROOT_PASSWORD') }}" diff --git a/provision/roles/boilerplate-main/templates/nginx/vhost.conf.j2 b/provision/roles/boilerplate-main/templates/nginx/vhost.conf.j2 deleted file mode 100644 index e2bbdb5..0000000 --- a/provision/roles/boilerplate-main/templates/nginx/vhost.conf.j2 +++ /dev/null @@ -1,69 +0,0 @@ -####################################### -# Vhost -####################################### -{% for vhost in WEB.vhost %} - -# Vhost for "{{ vhost.serverName }}" - -server { - listen 80; - - server_name {{ vhost.serverName }} {{ vhost.serverAlias }}; - access_log /dev/stdout; - error_log /dev/stdout info; - - root "{{ vhost.documentRoot|default('') }}"; - index "{{ vhost.documentIndex|default('') }}"; - - client_max_body_size 50m; - - location / { - try_files $uri $uri/ /{{ vhost.documentIndex|default('') }}?$query_string; - } - - location ~ \.php$ { - fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_pass php; - include fastcgi_params; - - fastcgi_param SCRIPT_FILENAME $request_filename; - fastcgi_read_timeout 1000; - } - - include /opt/docker/etc/nginx/vhost.common.conf; -} - -############## -# SSL -############## - -server { - listen 443; - - server_name {{ vhost.serverName }} {{ vhost.serverAlias }}; - access_log /dev/stdout; - error_log /dev/stdout info; - - root "{{ vhost.documentRoot|default('') }}"; - index "{{ vhost.documentIndex|default('') }}"; - - client_max_body_size 50m; - - location / { - try_files $uri $uri/ /{{ vhost.documentIndex|default('') }}?$query_string; - } - - location ~ \.php$ { - fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_pass php; - include fastcgi_params; - - fastcgi_param SCRIPT_FILENAME $request_filename; - fastcgi_read_timeout 1000; - } - - include /opt/docker/etc/nginx/vhost.common.conf; - include /opt/docker/etc/nginx/vhost.ssl.conf; -} - -{% endfor %}