Skip to content

Commit

Permalink
Merge branch 'release/4.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
mblaschke committed Aug 17, 2015
2 parents 4c62ecd + d9d98de commit 8c8d386
Show file tree
Hide file tree
Showing 108 changed files with 1,757 additions and 665 deletions.
19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
TYPO3 Docker Boilerplate Changelog
PHP Docker Boilerplate Changelog
==================================

4.0.0 - 2015-08-17
------------------
- Seperated TYPO3 Docker Boilerplate and PHP Docker Boilerplate
- Switched to Ansible provisioning (playbook)
- Added multiple Ubuntu versions
- Added CentOS
- Added Ubuntu with HHVM
- Added development/production context
- Added blackfire.io
- Added possiblity to disable Xdebug and Blackfire
- Moved php.ini to `etc/php/development.ini` and `etc/php/production.ini`
- Added ssh key/config (`etc/ssh`) setting for `/home/.ssh/`
- Added possibility to use `supervisorctl` (only for root)
- Improved provisioning
- Refactored layout
- Added prebuilt Docker images

3.5.0 - 2015-06-23
-----------------------
- Added `ftp` container (with vsftpd)
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
# Dockerized PHP web project boilerplate

![latest v3.5.0](https://img.shields.io/badge/latest-v3.5.0-green.svg?style=flat)
[![latest v4.0.0](https://img.shields.io/badge/latest-v4.0.0-green.svg?style=flat)](https://github.com/webdevops/php-docker-boilerplate/releases/tag/4.0.0)
![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/typo3-docker-boilerplate.svg)](http://isitmaintained.com/project/mblaschke/typo3-docker-boilerplate "Average time to resolve an issue")
[![Percentage of issues still open](http://isitmaintained.com/badge/open/mblaschke/typo3-docker-boilerplate.svg)](http://isitmaintained.com/project/mblaschke/typo3-docker-boilerplate "Percentage of issues still open")
[![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 _TYPO3 CMS_, _Symfony Framework_, _FLOW/NEOS_ and many other frameworks or applications.
This is an easy customizable docker boilerplate for any PHP based projects like _Symfony Framework_, _CakePHP_, _Yii_ and many other frameworks or applications.

Supports:

- Nginx or Apache HTTPd
- PHP-FPM (with Xdebug)
- MySQL, MariaDB or PerconaDB
- PostgreSQL
- Solr (disabled, with TYPO3 CMS EXT:solr configuration as example)
- Solr (disabled, without configuration)
- Elasticsearch (disabled, without configuration)
- Redis (disabled)
- Memcached (disabled)
- Mailcatcher (if no mail sandbox is used, eg. [Vagrant Development VM](https://github.com/mblaschke/vagrant-development))
- FTP server (vsftpd)
- Support for `TYPO3_CONTEXT` and `FLOW_CONTEXT` for TYPO3, FLOW, NEOS.
- maybe more later...

This Docker boilerplate based on the best practises and don't use too much magic.
Configuration of each docker container is available in the `docker/` directory - feel free to customize.

This boilerplate can also be used for any other web project eg. Symfony, Magento and more.
This boilerplate can also be used for any other web project eg. Symfony, CakePHP, Magento and more.
Just customize the makefile for your needs

Warning: There may be issues when using it in production - if you have any success stories please contact me.

Use can use my [Vagrant Development VM](https://github.com/mblaschke/vagrant-development) for this Docker boilerplate, eg. for easy creating new boilerplate installations with an easy shell command: `ct docker:create directory`
You can use my [Vagrant Development VM](https://github.com/mblaschke/vagrant-development) for this Docker boilerplate, eg. for easy creating new boilerplate installations with an easy shell command: `ct docker:create directory`

## Table of contents

- [Installation and requirements](/documentation/INSTALL.md)
- [Updating docker boilerplate](/documentation/UPDATE.md)
- [Customizing](/documentation/CUSTOMIZE.md)
- [Services (Webserver, MySQL... Ports, Users, Passwords)](/documentation/SERVICES.md)
- [Docker Quickstart](/documentation/DOCKER-QUICKSTART.md)
- [Run your project](/documentation/DOCKER-STARTUP.md)
- [Container detail info](/documentation/DOCKER-INFO.md)
Expand Down
4 changes: 2 additions & 2 deletions bin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -o errexit ## set -e : exit the script if any statement returns a non-true
source "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/.config.sh"

function excludeFilter {
cat | grep -v -E -e '(/typo3/|/typo3_src|/fileadmin/|/typo3temp/|/uploads/|/Packages/|/Data/|/vendor/)'
cat | grep -v -E -e '(/Packages/|/Data/|/vendor/)'
}

#######################################
Expand Down Expand Up @@ -59,7 +59,7 @@ done
## Gulp
#######################################

sectionHeader "Checking for gulpfile.js in T3 Root ..."
sectionHeader "Checking for gulpfile.js ..."

find "$CODE_DIR" -type f -name 'package.json' | excludeFilter | while read FILE; do
GULPFILE_DIR=$(dirname $($READLINK -f "$FILE"))
Expand Down
15 changes: 0 additions & 15 deletions bin/create-project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,6 @@ chmod 777 "$CODE_DIR/"
rm -f -- "$CODE_DIR/.gitkeep"

case "$1" in
###################################
## TYPO3 CMS
###################################
"typo3")
execInDir "$CODE_DIR" "composer create-project typo3/cms-base-distribution \"$CODE_DIR\""
execInDir "$CODE_DIR" "touch FIRST_INSTALL"
;;

###################################
## TYPO3 NEOS
###################################
"neos")
execInDir "$CODE_DIR" "composer create-project typo3/neos-base-distribution \"$CODE_DIR\""
;;

###################################
## SYMFONY
###################################
Expand Down
15 changes: 11 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
# Main php container
#######################################
main:
build: docker/main/
build: docker/main
#dockerfile: Ubuntu-12.04 # Ubuntu 12.04 - PHP 5.3, LTS (precise)
dockerfile: Ubuntu-14.04 # Ubuntu 14.04 - PHP 5.5, LTS (trusty)
#dockerfile: Ubuntu-15.04 # Ubuntu 15.04 - PHP 5.6 (vivid)
#dockerfile: Ubuntu-15.10 # Ubuntu 15.10 - PHP 5.6 (wily)
#dockerfile: Ubuntu-HHVM # Ubuntu 14.04 - HHVM (trusty)
#dockerfile: Centos-7 # CentOS 7 - PHP 5.4
links:
- mysql
#- postgres
Expand All @@ -28,8 +34,9 @@ main:
# Webserver
#######################################
web:
build: docker/httpd/
#build: docker/nginx/
build: docker/web
dockerfile: Apache-Httpd # Apache HTTPd
#dockerfile: Nginx # Nginx
ports:
- 8000:80
- 8443:443
Expand All @@ -45,7 +52,7 @@ web:
# MySQL server
#######################################
mysql:
build: docker/mysql/
build: docker/mysql/ # MySQL, MariaDB or PerconaDB
ports:
- 13306:3306
volumes_from:
Expand Down
44 changes: 25 additions & 19 deletions docker-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,39 @@
#######################################
# Webserver

# TYPO3 CMS
# General
DOCUMENT_ROOT=code/
DOCUMENT_INDEX=index.php
CLI_SCRIPT=php typo3/cli_dispatch.phpsh
CLI_SCRIPT=php index.php

# SYMFONY FRAMEWORK
#DOCUMENT_ROOT=code/web/
#DOCUMENT_INDEX=app_dev.php
#CLI_SCRIPT=php app/console

# NEOS or FLOW
#DOCUMENT_ROOT=code/Web/
#DOCUMENT_INDEX=index.php
#CLI_SCRIPT=php flow
# Symfony
# DOCUMENT_ROOT=code/web/
# DOCUMENT_INDEX=app_dev.php
# CLI_SCRIPT=php app/console

#######################################
# Context environment
TYPO3_CONTEXT=Development/Docker
FLOW_CONTEXT=Development/Docker
FLOW_REWRITEURLS=1

# Symfony
SYMFONY_ENV=dev
SYMFONY_DEBUG=0

# CakePHP
CAKE_ENV=dev

# yii
YII_ENVIRONMENT=Development

#######################################
# PROVISION environment

# Context for provision [development|production]
PROVISION_CONTEXT=development

# PHP Modules
PROVISION_PHP_BLACKFIRE=1
PROVISION_PHP_XDEBUG=1

#######################################
# Mail

Expand All @@ -56,7 +66,7 @@ DNS_DOMAIN=vm vm.dev
MYSQL_ROOT_PASSWORD=dev
MYSQL_USER=dev
MYSQL_PASSWORD=dev
MYSQL_DATABASE=typo3
MYSQL_DATABASE=database

#######################################
# PostgreSQL settings
Expand All @@ -70,10 +80,6 @@ FTP_PASSWORD=dev
FTP_PATH=/data/ftp/
#FTP_PATH=/docker/code/

#######################################
# PHP Settings
PHP_TIMEZONE=UTC

#######################################
# Permission settings
EFFECTIVE_UID=1000
Expand Down
11 changes: 11 additions & 0 deletions docker/elasticsearch/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
#++++++++++++++++++++++++++++++++++++++
# Elasticsearch Docker container
#++++++++++++++++++++++++++++++++++++++
#
# Official images:
#
# elasticsearch - official Elasticsaerch
# https://registry.hub.docker.com/u/library/elasticsearch/
#
#++++++++++++++++++++++++++++++++++++++

FROM elasticsearch
15 changes: 0 additions & 15 deletions docker/httpd/Dockerfile

This file was deleted.

11 changes: 11 additions & 0 deletions docker/mail/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
#++++++++++++++++++++++++++++++++++++++
# Mailcatcher Docker container
#++++++++++++++++++++++++++++++++++++++
#
# Images:
#
# schickling/mailcatcher
# https://registry.hub.docker.com/u/schickling/mailcatcher/
#
#++++++++++++++++++++++++++++++++++++++

FROM schickling/mailcatcher
59 changes: 59 additions & 0 deletions docker/main/Centos-7
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#++++++++++++++++++++++++++++++++++++++
# Centos PHP Docker container
#++++++++++++++++++++++++++++++++++++++
#
# Prebuild images:
#
# webdevops/php-boilerplate:centos-7
#
# Official images:
#
# centos:7 - PHP 5.4
# https://registry.hub.docker.com/u/library/centos/
#
#++++++++++++++++++++++++++++++++++++++

FROM webdevops/php-boilerplate:centos-7

ENV PROVISION_SYS_UPDATE 0
ENV PROVISION_PHP_DISTRIBUTION php

ENV PATH /opt/ansible/bin:/bin:/usr/bin:/sbin:/usr/sbin
ENV PYTHONPATH /opt/ansible/lib
ENV ANSIBLE_LIBRARY /opt/ansible/library

##
# Bootstrap
##

COPY conf/centos/locale.conf /opt/docker/locale.conf
COPY bin/centos/bootstrap.sh /opt/docker/bin/bootstrap.sh
COPY bin/provision.sh /opt/docker/bin/provision.sh
COPY bin/logwatch.sh /opt/docker/bin/logwatch.sh
COPY bin/dnsmasq.sh /opt/docker/bin/dnsmasq.sh
COPY provision /opt/docker/provision/

RUN bash /opt/docker/bin/bootstrap.sh
RUN bash /opt/docker/bin/provision.sh bootstrap

##
# Customization
##

COPY bin/customization.sh /opt/docker/bin/customization.sh
RUN bash /opt/docker/bin/customization.sh

##
# Config
##

COPY bin/entrypoint.sh /entrypoint.sh
COPY conf/centos /opt/docker/conf/

EXPOSE 9000

VOLUME /docker/
WORKDIR /docker/code/

ENTRYPOINT ["/entrypoint.sh"]
CMD ["supervisord"]
24 changes: 0 additions & 24 deletions docker/main/Dockerfile

This file was deleted.

Loading

0 comments on commit 8c8d386

Please sign in to comment.