diff --git a/CHANGELOG.md b/CHANGELOG.md index daef858..1a6ceef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,17 @@ -PHP Docker Boilerplate Changelog +TYPO3 Docker Boilerplate Changelog ================================== +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) diff --git a/Dockerfile.cloud b/Dockerfile.cloud index d036d88..c2a7278 100644 --- a/Dockerfile.cloud +++ b/Dockerfile.cloud @@ -43,7 +43,7 @@ # #++++++++++++++++++++++++++++++++++++++ -FROM webdevops/php-apache:ubuntu-14.04 +FROM webdevops/php-apache:ubuntu-16.04 ENV PROVISION_CONTEXT "production" @@ -53,7 +53,7 @@ COPY provision/ /opt/docker/provision/ COPY app/ /app/ -RUN /opt/docker/bin/provision add --tag bootstrap --tag entrypoint boilerplate-main boilerplate-deployment \ +RUN /opt/docker/bin/provision run --tag bootstrap --role boilerplate-main --role boilerplate-deployment \ && /opt/docker/bin/bootstrap.sh # Configure volume/workdir diff --git a/Dockerfile.development b/Dockerfile.development index 5c1ce6e..b425475 100644 --- a/Dockerfile.development +++ b/Dockerfile.development @@ -43,7 +43,7 @@ # #++++++++++++++++++++++++++++++++++++++ -FROM webdevops/php-apache-dev:ubuntu-14.04 +FROM webdevops/php-apache-dev:ubuntu-16.04 ENV PROVISION_CONTEXT "development" @@ -51,7 +51,7 @@ ENV PROVISION_CONTEXT "development" COPY etc/ /opt/docker/etc/ COPY provision/ /opt/docker/provision/ -RUN /opt/docker/bin/provision add --tag bootstrap --tag entrypoint boilerplate-main boilerplate-main-development boilerplate-deployment \ +RUN /opt/docker/bin/provision run --tag bootstrap --role boilerplate-main --role boilerplate-main-development --role boilerplate-deployment \ && /opt/docker/bin/bootstrap.sh # Configure volume/workdir diff --git a/Dockerfile.production b/Dockerfile.production index 271bd3b..4f81446 100644 --- a/Dockerfile.production +++ b/Dockerfile.production @@ -43,7 +43,7 @@ # #++++++++++++++++++++++++++++++++++++++ -FROM webdevops/php-apache:ubuntu-14.04 +FROM webdevops/php-apache:ubuntu-16.04 ENV PROVISION_CONTEXT "production" @@ -51,7 +51,7 @@ ENV PROVISION_CONTEXT "production" COPY etc/ /opt/docker/etc/ COPY provision/ /opt/docker/provision/ -RUN /opt/docker/bin/provision add --tag bootstrap --tag entrypoint boilerplate-main boilerplate-deployment \ +RUN /opt/docker/bin/provision run --tag bootstrap --role boilerplate-main --role boilerplate-deployment \ && /opt/docker/bin/bootstrap.sh # Configure volume/workdir diff --git a/README.md b/README.md old mode 100644 new mode 100755 index 5b840f0..62442c0 --- a/README.md +++ b/README.md @@ -1,9 +1,7 @@ ![TYPO3 Docker Boilerplate](https://static.webdevops.io/typo3-docker-boilerplate.svg) -[![latest v5.1.3](https://img.shields.io/badge/latest-v5.1.3-green.svg?style=flat)](https://github.com/webdevops/TYPO3-docker-boilerplate/releases/tag/5.1.3) +[![latest v5.2.0-beta1](https://img.shields.io/badge/latest-v5.2.0-beta1-green.svg?style=flat)](https://github.com/webdevops/TYPO3-docker-boilerplate/releases/tag/5.2.0-beta1) ![License MIT](https://img.shields.io/badge/license-MIT-blue.svg?style=flat) -[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/webdevops/typo3-docker-boilerplate.svg)](http://isitmaintained.com/project/webdevops/typo3-docker-boilerplate "Average time to resolve an issue") -[![Percentage of issues still open](http://isitmaintained.com/badge/open/webdevops/typo3-docker-boilerplate.svg)](http://isitmaintained.com/project/webdevops/typo3-docker-boilerplate "Percentage of issues still open") This is an easy customizable TYPO3 docker boilerplate. @@ -19,6 +17,7 @@ Supports: - Memcached (disabled) - Mailcatcher (if no mail sandbox is used, eg. [Vagrant Development VM](https://github.com/webdevops/vagrant-development)) - FTP server (vsftpd) +- PhpMyAdmin - Support for `TYPO3_CONTEXT` and `FLOW_CONTEXT` for TYPO3, FLOW, NEOS. - maybe more later... diff --git a/bin/build.sh b/bin/build.sh index 0e7c7bf..24a13d3 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 -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 2eb788f..9a15e54 100755 --- a/bin/create-project.sh +++ b/bin/create-project.sh @@ -21,7 +21,7 @@ case "$1" in ## TYPO3 CMS ################################### "typo3") - execInDir "$CODE_DIR" "composer create-project typo3/cms-base-distribution \"$CODE_DIR\"" + execInDir "$CODE_DIR" "docker run --rm -v $(pwd):/app composer/composer:alpine create-project typo3/cms-base-distribution \"$CODE_DIR\"" execInDir "$CODE_DIR" "touch web/FIRST_INSTALL" ;; @@ -29,7 +29,7 @@ case "$1" in ## TYPO3 NEOS ################################### "neos") - execInDir "$CODE_DIR" "composer create-project typo3/neos-base-distribution \"$CODE_DIR\"" + execInDir "$CODE_DIR" "docker run --rm -v $(pwd):/app composer/composer:alpine create-project typo3/neos-base-distribution \"$CODE_DIR\"" ;; ################################### diff --git a/docker-compose.cloud.yml b/docker-compose.cloud.yml index ea71f45..e9412f1 100644 --- a/docker-compose.cloud.yml +++ b/docker-compose.cloud.yml @@ -1,136 +1,150 @@ -####################################### -# 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 + restart: always + 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 + restart: always + 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 + # restart: always + # 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/ + # restart: always + # 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/ + # restart: always + # 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/ + # restart: always + # 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/ + # restart: always + # 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/ + # restart: always + # 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: - - /storage + ####################################### + # Storage + ####################################### + storage: + build: + context: docker/storage/ + restart: always + volumes: + - /storage diff --git a/docker-compose.development.yml b/docker-compose.development.yml old mode 100644 new mode 100755 index 6c01368..e9d3171 --- a/docker-compose.development.yml +++ b/docker-compose.development.yml @@ -1,150 +1,189 @@ -####################################### -# 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: + - mailhog + - mysql + #- postgres + #- 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 + environment: + - VIRTUAL_HOST=.app.boilerplate.docker + - VIRTUAL_PORT=80 -####################################### -# 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 + ####################################### + # 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_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 + ####################################### + # PostgreSQL server + ####################################### + #postgres: + # build: + # context: docker/postgres/ + # dockerfile: Postgres-9.4.Dockerfile + # dockerfile: Postgres-9.5.Dockerfile + # ports: + # - 15432:5432 + # volumes_from: + # - storage + # 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 + ####################################### + # Solr server + ####################################### + #solr: + # build: + # context: docker/solr/ + # ports: + # - 18983:8983 + # volumes_from: + # - storage + # environment: + # - SOLR_STORAGE=/storage/solr/server-master/ + # env_file: + # - etc/environment.yml + # - etc/environment.development.yml + # environment: + # - VIRTUAL_HOST=solr.boilerplate.docker + # - VIRTUAL_PORT=8983 -####################################### -# Elasticsearch -####################################### -#elasticsearch: -# build: docker/elasticsearch/ -# ports: -# - 19200:9200 -# - 19300:9300 -# volumes_from: -# - storage -# env_file: -# - etc/environment.yml -# - etc/environment.development.yml + ####################################### + # Elasticsearch + ####################################### + #elasticsearch: + # build: + # context: docker/elasticsearch/ + # ports: + # - 19200:9200 + # - 19300:9300 + # volumes_from: + # - storage + # env_file: + # - etc/environment.yml + # - etc/environment.development.yml + # environment: + # - VIRTUAL_HOST=elasticsearch.boilerplate.docker + # - VIRTUAL_PORT=9200 -####################################### -# Redis -####################################### -#redis: -# build: docker/redis/ -# volumes_from: -# - storage -# env_file: -# - etc/environment.yml -# - etc/environment.development.yml + ####################################### + # Redis + ####################################### + #redis: + # build: + # context: docker/redis/ + # volumes_from: + # - storage + # env_file: + # - etc/environment.yml + # - etc/environment.development.yml -####################################### -# Memcached -####################################### -#memcached: -# build: docker/memcached/ -# volumes_from: -# - storage -# env_file: -# - etc/environment.yml -# - etc/environment.development.yml + ####################################### + # Memcached + ####################################### + #memcached: + # build: + # context: docker/memcached/ + # volumes_from: + # - storage + # env_file: + # - etc/environment.yml + # - etc/environment.development.yml -####################################### -# Mailcatcher -####################################### -#mail: -# build: docker/mail/ -# ports: -# - 1080:1080 -# env_file: -# - etc/environment.yml -# - etc/environment.development.yml + ####################################### + # Mailhog + ####################################### + mailhog: + image: mailhog/mailhog + ports: + - 8025:8025 + environment: + - VIRTUAL_HOST=mail.boilerplate.docker + - VIRTUAL_PORT=8025 -####################################### -# FTP (vsftpd) -####################################### -#ftp: -# build: docker/vsftpd/ -# volumes_from: -# - storage -# volumes: -# - ./:/application/ -# env_file: -# - etc/environment.yml -# - etc/environment.development.yml + ####################################### + # FTP (vsftpd) + ####################################### + #ftp: + # build: + # context: docker/vsftpd/ + # volumes_from: + # - storage + # volumes: + # - ./:/application/ + # env_file: + # - etc/environment.yml + # - etc/environment.development.yml -####################################### -# Storage -####################################### -storage: - build: docker/storage/ - volumes: - - /storage + ####################################### + # phpMyAdmin + ####################################### + #phpmyadmin: + # image: phpmyadmin/phpmyadmin + # links: + # - mysql + # environment: + # - PMA_ARBITRARY=1 + # - VIRTUAL_HOST=pma.boilerplate.docker + # - VIRTUAL_PORT=80 + # ports: + # - "8001:80" + # volumes: + # - /sessions + + ####################################### + # Storage + ####################################### + storage: + build: + context: docker/storage/ + volumes: + - /storage diff --git a/docker-compose.production.yml b/docker-compose.production.yml index 89398a7..0ea5589 100644 --- a/docker-compose.production.yml +++ b/docker-compose.production.yml @@ -1,142 +1,154 @@ -####################################### -# 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" + restart: always + volumes: + - ./app/:/app/ + 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 - 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 + restart: always + volumes_from: + - storage + volumes: + - /tmp/debug/:/tmp/debug/ + 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 + # restart: always + # volumes_from: + # - storage + # 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 + # restart: always + # volumes_from: + # - storage + # environment: + # - SOLR_STORAGE=/storage/solr/server-master/ + # 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 + # restart: always + # 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/ + # restart: always + # 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/ + # restart: always + # volumes_from: + # - storage + # 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/vsftp/ + # restart: always + # volumes_from: + # - storage + # 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: - - /storage + ####################################### + # Storage + ####################################### + storage: + build: + context: docker/storage/ + restart: always + volumes: + - /storage 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 100% rename from docker/mysql/MariaDB-10 rename to docker/mysql/MariaDB-10.Dockerfile diff --git a/docker/mysql/MariaDB-5.5 b/docker/mysql/MariaDB-5.5.Dockerfile similarity index 100% rename from docker/mysql/MariaDB-5.5 rename to docker/mysql/MariaDB-5.5.Dockerfile diff --git a/docker/mysql/MySQL-5.5 b/docker/mysql/MySQL-5.5.Dockerfile similarity index 100% rename from docker/mysql/MySQL-5.5 rename to docker/mysql/MySQL-5.5.Dockerfile diff --git a/docker/mysql/MySQL-5.6 b/docker/mysql/MySQL-5.6.Dockerfile similarity index 100% rename from docker/mysql/MySQL-5.6 rename to docker/mysql/MySQL-5.6.Dockerfile diff --git a/docker/mysql/MySQL-5.7 b/docker/mysql/MySQL-5.7.Dockerfile similarity index 100% rename from docker/mysql/MySQL-5.7 rename to docker/mysql/MySQL-5.7.Dockerfile diff --git a/docker/mysql/Percona-5.5 b/docker/mysql/Percona-5.5.Dockerfile similarity index 100% rename from docker/mysql/Percona-5.5 rename to docker/mysql/Percona-5.5.Dockerfile diff --git a/docker/mysql/Percona-5.6 b/docker/mysql/Percona-5.6.Dockerfile similarity index 100% rename from docker/mysql/Percona-5.6 rename to docker/mysql/Percona-5.6.Dockerfile diff --git a/docker/mysql/Percona-5.7.Dockerfile b/docker/mysql/Percona-5.7.Dockerfile new file mode 100644 index 0000000..64e87f4 --- /dev/null +++ b/docker/mysql/Percona-5.7.Dockerfile @@ -0,0 +1,14 @@ +#++++++++++++++++++++++++++++++++++++++ +# 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 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/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/SERVICES.md b/documentation/SERVICES.md old mode 100644 new mode 100755 index 9dd631f..a8c4444 --- 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/content/gettingStarted/index.rst b/documentation/docs/content/gettingStarted/index.rst index 47322f6..38f6a07 100644 --- a/documentation/docs/content/gettingStarted/index.rst +++ b/documentation/docs/content/gettingStarted/index.rst @@ -6,16 +6,39 @@ Getting Started Requirements ------------ -This section is not done yet! +* Docker host (eg. Vagrant Docker VM or dinghy) +* Docker compose ------------ Installation ------------ -This section is not done yet! +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 ----- -This section is not done yet! +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 index eca8451..c56661c 100644 --- a/documentation/docs/content/introduction.rst +++ b/documentation/docs/content/introduction.rst @@ -2,10 +2,9 @@ Introduction ============ -Introduction Content - ----------------------------------------- What is the TYPO3 Docker Boilerplate for? ----------------------------------------- -This section is not done yet! +This TYPO3 Docker Boilerplate is for an example layout for an TYPO3 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 index 788101b..012302e 100644 --- a/documentation/docs/content/usage/dockerCompose.rst +++ b/documentation/docs/content/usage/dockerCompose.rst @@ -2,4 +2,6 @@ Docker Compose Configuration ============================ -This section is not done yet! +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 index 45c15a6..dcda8ad 100644 --- a/documentation/docs/content/usage/dockerImages.rst +++ b/documentation/docs/content/usage/dockerImages.rst @@ -1,5 +1,6 @@ -====================== -Altering Docker Images -====================== +========================= +Customizing Docker Images +========================= + +The main `Dockerfile.*` for the php application container can be customized as any normal Dockerfile image. -This section is not done yet! diff --git a/documentation/docs/content/usage/vagrantDockerVM.rst b/documentation/docs/content/usage/vagrantDockerVM.rst index a7f7284..b0e7e7c 100644 --- a/documentation/docs/content/usage/vagrantDockerVM.rst +++ b/documentation/docs/content/usage/vagrantDockerVM.rst @@ -2,4 +2,9 @@ Synergy with Vagrant Docker VM ============================== -This section is not done yet! +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 index 516ceca..715383d 100644 --- a/documentation/docs/index.rst +++ b/documentation/docs/index.rst @@ -18,7 +18,7 @@ Overview .. toctree:: - Back to Project Overview + Back to Project Overview content/introduction .. toctree:: diff --git a/etc/application.development.yml b/etc/application.development.yml index 20f6f47..6a4ba22 100644 --- a/etc/application.development.yml +++ b/etc/application.development.yml @@ -1,8 +1,6 @@ --- PROVISION: - systemUpdate: false - install: apacheModPagespeed: false @@ -25,7 +23,7 @@ MAIL: - { user: "root", destination: "root@example.com" } conf: - { variable: "inet_interfaces", value: "loopback-only" } - # - { variable: "relayhost", value: "foobar" } + - { variable: "relayhost", value: "[mailcatcher]:1025" } PHP: fpm: 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 index 00e29bd..4e3f07f 100644 --- a/etc/application.production.yml +++ b/etc/application.production.yml @@ -1,8 +1,6 @@ --- PROVISION: - systemUpdate: true - install: apacheModPagespeed: false diff --git a/etc/environment.development.yml b/etc/environment.development.yml index 1a97e86..8385bf9 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 diff --git a/etc/environment.yml b/etc/environment.yml index 485d0ef..eeae387 100644 --- a/etc/environment.yml +++ b/etc/environment.yml @@ -39,6 +39,7 @@ MYSQL_DATABASE=typo3 # PostgreSQL settings POSTGRES_USER=dev POSTGRES_PASSWORD=dev +POSTGRES_DATABASE=dev ####################################### # FTP settings diff --git a/provision/roles/boilerplate-main-development/tasks/bootstrap.yml b/provision/roles/boilerplate-main-development/tasks/bootstrap.yml index eb4bee1..ed97d53 100644 --- a/provision/roles/boilerplate-main-development/tasks/bootstrap.yml +++ b/provision/roles/boilerplate-main-development/tasks/bootstrap.yml @@ -1,7 +1 @@ --- - -- 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 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/tasks/bootstrap.yml b/provision/roles/boilerplate-main/tasks/bootstrap.yml index eb3f70a..9e29b8f 100644 --- a/provision/roles/boilerplate-main/tasks/bootstrap.yml +++ b/provision/roles/boilerplate-main/tasks/bootstrap.yml @@ -9,15 +9,6 @@ # 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 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 index f757621..4e9ee0e 100644 --- a/provision/roles/boilerplate-main/tasks/bootstrap/cron.yml +++ b/provision/roles/boilerplate-main/tasks/bootstrap/cron.yml @@ -6,6 +6,13 @@ dest: '/etc/cron.d/docker-boilerplate' state: link force: yes + mode: '0644' + +- name: Permissions of crontab + file: + path: '/opt/docker/etc/cron/crontab' + state: touch + mode: '0644' - name: Add newline to crontab raw: 'echo >> /opt/docker/etc/crontab' diff --git a/provision/roles/boilerplate-main/tasks/bootstrap/php.yml b/provision/roles/boilerplate-main/tasks/bootstrap/php.yml index e0c09b9..8c21955 100644 --- a/provision/roles/boilerplate-main/tasks/bootstrap/php.yml +++ b/provision/roles/boilerplate-main/tasks/bootstrap/php.yml @@ -2,13 +2,30 @@ - include_vars: "/opt/docker/etc/application.{{ PROVISION_CONTEXT }}.yml" +############################# +# Stats +############################# + +- stat: + path: /opt/docker/etc/php/fpm/php-fpm.conf + register: phpFpmConf + +- stat: + path: /opt/docker/etc/php/fpm/pool.d/application.conf + register: phpFpmApplicationPool + +############################# +# Tasks +############################# + - 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 != "" + when: PHP.fpm.conf is defined and item.value != "" and + phpFpmApplicationPool.stat.exists is defined and phpFpmApplicationPool.stat.exists - name: Configure php-fpm (php-fpm.conf) lineinfile: @@ -17,6 +34,7 @@ line: '{{ item.key }} = {{ item.value }}' with_items: - { key: 'daemonize', value: 'no' } + when: phpFpmConf.stat.exists is defined and phpFpmConf.stat.exists - name: Set development environment php.ini file: 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/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 index 7895a52..1806c1a 100644 --- a/provision/roles/boilerplate-main/tasks/main.yml +++ b/provision/roles/boilerplate-main/tasks/main.yml @@ -3,7 +3,3 @@ - include: bootstrap.yml tags: - bootstrap - -- include: entrypoint.yml - tags: - - entrypoint