Skip to content

Commit 87e5bf1

Browse files
committed
Merge branch 'release/3.3.0'
# Conflicts: # README.md # docker/httpd/ssl/server.crt # docker/httpd/ssl/server.csr # docker/nginx/ssl/server.crt # docker/nginx/ssl/server.csr
2 parents c026eef + a383189 commit 87e5bf1

File tree

17 files changed

+261
-46
lines changed

17 files changed

+261
-46
lines changed

CHANGELOG.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
TYPO3 Docker Boilerplate Changelog
2+
==================================
3+
4+
3.3.0 - 2015-05-09 - t3cs2015 release
5+
-------------------------------------
6+
- Fixed `make mysql-backup`
7+
- Added `docker/main/bin/customization.sh` for easy customization and faster docker rebuilding
8+
- Added `CLI_USER` for customizable user in `docker-env.yml` (for `CLI_SCRIPT`)
9+
- Added ssl (SHA2) for nginx and apache HTTPd
10+
- Added `/data/cache` for application cache storage (inside `storage` container)
11+
- Improved `make deploy` (supports all other frameworks now, not only TYPO3)
12+
- Fixed $HOME variable for shell and cli entrypoint targets (sudo issue)
13+
- Improved `docker-env.yml` layout with some examples
14+
15+
3.2.0 - 2015-04-26
16+
------------------
17+
- Added `mailcatcher` container
18+
- Added `cli` target for entrypoint in `main` container
19+
- Smaller improvements
20+
21+
3.0.0 - 2015-04-19
22+
------------------
23+
- Added customizeable `PHP_UID` and `PHP_GID` (for www-data user) in `docker-env.yml`
24+
- Added `PHP_TIMEZONE` in `docker-env.yml`
25+
- Added advanced logging for php (see docker-compose logs for access, slowlog and errorlog)
26+
- Added capability for PHP-FPM to trace for slowlog
27+
- Added possibility to reach webserver from php-container (with dnsmasq) eg. for indexing tasks
28+
- Readded xdebug
29+
- Improved configuration
30+
- Improved database backup
31+
- Improved container layout
32+
33+
2.1.0 - 2015-04-01
34+
------------------
35+
- Added customizeable `DOCUMENT_INDEX` in `docker-env.yml`
36+
37+
2.0.0 - 2015-03-31
38+
------------------
39+
- Added customizeable `DOCUMENT_ROOT` in `docker-env.yml`
40+
- Switched to official nginx
41+
- Moved `/code/` to `/docker`
42+
- Fixed some bugs

README.md

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
# Dockerized PHP web project boilerplate
22

3-
![latest v3.2.0](https://img.shields.io/badge/latest-v3.2.0-green.svg?style=flat)
3+
![latest v3.3.0](https://img.shields.io/badge/latest-v3.3.0-green.svg?style=flat)
44
![License MIT](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)
55
[![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")
66
[![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")
77

8-
9-
This is a boilerplate utilizing Docker based with support
10-
for **TYPO3_CONTEXT** and **FLOW_CONTEXT** for TYPO3, FLOW, NEOS.
11-
It also supports Symfony and any other PHP base project.
8+
This is an easy customizable docker boilerplate for any PHP based projects like _TYPO3 CMS_, _TYPO3 NEOS_, _TYPO3 FLOW_, _Symfony Framework_ and many other.
129

1310
Supports:
1411

1512
- Nginx or Apache HTTPd
16-
- PHP-FPM (with Xdebug and Xhprof)
13+
- PHP-FPM (with Xdebug)
1714
- MySQL, MariaDB or PerconaDB
18-
- Solr (disabled, without EXT:solr configuration)
15+
- Solr (disabled, with TYPO3 CMS EXT:solr configuration as example)
1916
- Elasticsearch (disabled, without configuration)
2017
- Redis (disabled)
2118
- Memcached (disabled)
19+
- Mailcatcher (if no mail sandbox is used, eg. [Vagrant Development VM](https://github.com/mblaschke/vagrant-development))
20+
- Support for `TYPO3_CONTEXT` and `FLOW_CONTEXT` for TYPO3, FLOW, NEOS.
2221
- maybe more later...
2322

2423
This Docker boilerplate based on the best practises and don't use too much magic.
@@ -27,9 +26,9 @@ Configuration of each docker container is available in the `docker/` directory -
2726
This boilerplate can also be used for any other web project eg. Symfony, Magento and more.
2827
Just customize the makefile for your needs
2928

30-
Warning: Don't use this Docker containers for production - they are only for development!
29+
Warning: Don't use this Docker containers for production - they are only for development. If you find it usefull for production please contact me.
3130

32-
Use can use my [Vagrant Development VM](https://github.com/mblaschke/vagrant-development) for this Docker boilerplate.
31+
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`
3332

3433
## Requirements
3534

@@ -41,7 +40,7 @@ Use can use my [Vagrant Development VM](https://github.com/mblaschke/vagrant-dev
4140
If you want to run a Docker VM make sure you're using VMware or Parallels Desktop because of
4241
the much faster virtualisation (networking, disk access, shared folders) compared to VirtualBox.
4342

44-
For more convenience use [CliTools.phar](https://github.com/mblaschke/vagrant-clitools) (will also run on native Linux, not only Vagrant)
43+
For more convenience use [CliTools.phar](https://github.com/mblaschke/vagrant-clitools) (will also run on native Linux, not only inside a Vagrant box)
4544

4645
## Docker short introduction
4746

@@ -114,7 +113,7 @@ main | Main container with PHP-FPM and tools (your entrypoi
114113
storage | Storage container, eg. for Solr data
115114
web | Apache HTTPD or Nginx webserver
116115
mysql | MySQL database
117-
solr | Apache Solr server
116+
solr (optional) | Apache Solr server
118117
elasticsearch (optional) | Elasticsearch server
119118
memcached (optional) | Memcached server
120119
redis (optional) | Redis server
@@ -198,13 +197,22 @@ Setting | Value
198197
Host | memcached
199198
Port | 11211
200199

200+
### Mailcatcher
201+
202+
Setting | Value
203+
------------- | -------------
204+
Host | mail
205+
SMTP port | 1025
206+
Web port | 1080
207+
201208
### Environment settings
202209

203210
Environment | Description
204211
--------------------- | -------------
205212
DOCUMENT_ROOT | Document root for Nginx and Apache HTTPD, can be absolute or relative (to /docker inside the container).
206213
DOCUMENT_INDEX | Default document index file for Nginx and Apache HTTPd
207214
CLI_SCRIPT | Target for "cli" command of main container
215+
CLI_USER | User which should be used to run CLI scripts (normally www-data, equals php-fpm user)
208216
<br> |
209217
TYPO3_CONTEXT | Context for TYPO3, can be used for TypoScript conditions and AdditionalConfiguration
210218
FLOW_CONTEXT | Context for FLOW and NEOS
@@ -253,7 +261,7 @@ Use this boilerplate as template and customize it for each project. Put this Doc
253261
configuration for each project into seperate git repositories.
254262

255263
Now set your existing project repository to be a git submodule in `code/`.
256-
Every developer now needs only to clone the Docker repository with **--recursive**
264+
Every developer now needs only to clone the Docker repository with `--recursive` option
257265
to get both, the Docker configuration and the TYPO3 installation.
258266

259267
For better useability track a whole branch (eg. develop or master) as submodule and not just a single commit.
@@ -263,3 +271,4 @@ For better useability track a whole branch (eg. develop or master) as submodule
263271
This Docker layout is based on https://github.com/denderello/symfony-docker-example/
264272

265273
Thanks to [cron IT GmbH](http://www.cron.eu/) for the inspiration for this Docker boilerplate.
274+
Also thanks to Ingo Pfennigstorf for testing and some usefull ideas.

bin/backup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ case "$1" in
2525
fi
2626

2727
logMsg "Starting MySQL backup..."
28-
mysqldump --opt --single-transaction --all-databases | bzip2 > "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}"
28+
mysqldump --opt --single-transaction --events --all-databases | bzip2 > "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}"
2929
;;
3030

3131
###################################

bin/deploy.sh

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,30 @@ set -o errexit ## set -e : exit the script if any statement returns a non-true
77

88
source "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/.config.sh"
99

10-
#######################################
11-
## Checks
12-
#######################################
13-
14-
sectionHeader "Checking TYPO3 installation ..."
15-
16-
if [ ! -d "$CODE_DIR/fileadmin" -o ! -d "$CODE_DIR/typo3conf/ext/" ]; then
17-
errorMsg "Either $CODE_DIR/fileadmin or $CODE_DIR/typo3conf/ext/ doesn't exists"
18-
exit 1
19-
fi
10+
function excludeFilter {
11+
cat | grep -v -E -e '(/typo3/|/typo3_src|/fileadmin/|/typo3temp/|/uploads/|/Packages/|/Data/|/vendor/)'
12+
}
2013

2114
#######################################
2215
## Composer
2316
#######################################
2417

2518
sectionHeader "Checking for composer.json ..."
2619

27-
if [ -f "$CODE_DIR/composer.json" ]; then
28-
# Install composer
29-
execInDir "$CODE_DIR" "composer install --no-dev --no-interaction"
30-
fi
20+
find "$CODE_DIR" -type f -name 'composer.json' | excludeFilter | while read FILE; do
21+
COMPOSER_JSON_DIR=$(dirname $($READLINK -f "$FILE"))
22+
23+
execInDir "$COMPOSER_JSON_DIR" "composer install --no-dev --no-interaction"
24+
done
25+
3126

3227
#######################################
3328
## Bower
3429
#######################################
3530

3631
sectionHeader "Checking for bower.json ..."
3732

38-
find "$CODE_DIR/fileadmin" "$CODE_DIR/typo3conf/ext/" -type f -name 'bower.json' | while read FILE; do
33+
find "$CODE_DIR" -type f -name 'bower.json' | excludeFilter | while read FILE; do
3934
BOWER_JSON_DIR=$(dirname $($READLINK -f "$FILE"))
4035

4136
execInDir "$BOWER_JSON_DIR" "bower install --silent"
@@ -48,7 +43,7 @@ done
4843

4944
sectionHeader "Checking for package.json (npm) ..."
5045

51-
find "$CODE_DIR/fileadmin" "$CODE_DIR/typo3conf/ext/" -type f -name 'package.json' | while read FILE; do
46+
find "$CODE_DIR" -type f -name 'package.json' | excludeFilter | while read FILE; do
5247
PACKAGE_JSON_DIR=$(dirname $($READLINK -f "$FILE"))
5348

5449
if [ ! -d "$PACKAGE_JSON_DIR/node_modules/" -a -n "`which npm-cache`" ]; then
@@ -66,6 +61,8 @@ done
6661

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

69-
if [ -f "$CODE_DIR\gulpfile.js" ]; then
70-
execInDir "$CODE_DIR" "gulp deploy"
71-
fi
64+
find "$CODE_DIR" -type f -name 'package.json' | excludeFilter | while read FILE; do
65+
GULPFILE_DIR=$(dirname $($READLINK -f "$FILE"))
66+
67+
execInDir "$GULPFILE_DIR" "gulp deploy"
68+
done

docker-compose.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1+
#######################################
2+
# Main php container
3+
#######################################
14
main:
25
build: docker/main/
36
links:
47
- mysql
8+
#- mail
59
#- solr
610
#- elasticsearch
711
#- redis
@@ -18,6 +22,9 @@ main:
1822
env_file:
1923
- docker-env.yml
2024

25+
#######################################
26+
# Webserver
27+
#######################################
2128
web:
2229
#build: docker/httpd/
2330
build: docker/nginx/
@@ -32,6 +39,9 @@ web:
3239
env_file:
3340
- docker-env.yml
3441

42+
#######################################
43+
# MySQL server
44+
#######################################
3545
mysql:
3646
build: docker/mysql/
3747
ports:
@@ -43,6 +53,9 @@ mysql:
4353
env_file:
4454
- docker-env.yml
4555

56+
#######################################
57+
# Solr server
58+
#######################################
4659
#solr:
4760
# build: docker/solr/
4861
# ports:
@@ -54,6 +67,9 @@ mysql:
5467
# env_file:
5568
# - docker-env.yml
5669

70+
#######################################
71+
# Elasticsearch
72+
#######################################
5773
#elasticsearch:
5874
# build: docker/elasticsearch/
5975
# ports:
@@ -64,20 +80,39 @@ mysql:
6480
# env_file:
6581
# - docker-env.yml
6682

83+
#######################################
84+
# Redis
85+
#######################################
6786
#redis:
6887
# build: docker/redis/
6988
# volumes_from:
7089
# - storage
7190
# env_file:
7291
# - docker-env.yml
7392

93+
#######################################
94+
# Memcached
95+
#######################################
7496
#memcached:
7597
# build: docker/memcached/
7698
# volumes_from:
7799
# - storage
78100
# env_file:
79101
# - docker-env.yml
80102

103+
#######################################
104+
# Mailcatcher
105+
#######################################
106+
#mail:
107+
# build: docker/mail/
108+
# ports:
109+
# - 1080:1080
110+
# env_file:
111+
# - docker-env.yml
112+
113+
#######################################
114+
# Storage
115+
#######################################
81116
storage:
82117
build: docker/storage/
83118
volumes:

docker-env.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,13 @@ FLOW_REWRITEURLS=1
2020
SYMFONY_ENV=dev
2121
SYMFONY_DEBUG=0
2222

23-
# Service settings
23+
# Mail - Vagrant mail sandbox
2424
MAIL_GATEWAY=192.168.56.2
25+
26+
# Mail - Mailcatcher
27+
#MAIL_GATEWAY=mail:1025
28+
29+
# Service settings
2530
DNS_DOMAIN=vm vm.dev
2631

2732
# MySQL settings
@@ -34,3 +39,6 @@ MYSQL_DATABASE=typo3
3439
PHP_TIMEZONE=UTC
3540
PHP_UID=1000
3641
PHP_GID=1000
42+
43+
# Default cli user (should be www-data)
44+
CLI_USER=www-data

docker/httpd/ssl/server.crt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
-----BEGIN CERTIFICATE-----
2+
<<<<<<< HEAD
23
MIIFEjCCAvoCCQDrKLkQ7ypcWzANBgkqhkiG9w0BAQUFADBLMQswCQYDVQQGEwJE
34
RTEQMA4GA1UECBMHR2VybWFueTEbMBkGA1UEChMSRG9ja2VyIEJvaWxlcnBsYXRl
45
MQ0wCwYDVQQDFAQqLnZtMB4XDTE1MDQyOTIxMDIyNloXDTE2MDQyODIxMDIyNlow
@@ -27,4 +28,32 @@ rURpmpCRUiVIuq6noJtSFmKc/zLWXyv8ypofX9JHKtFiJr6DpxrzTtMABLLFMEQx
2728
kOnuIz7e9Mj/CMoXp68U4MBYhuoapd0u+tv3lXvZSxTdioLJtecG6qc6ZYoTGB7a
2829
BNAo1sCRQrae0LPt2TAMXos6EA+pqX6WyKrAcopQidy3UMp2PCRXfUgtVPwdiq82
2930
BAleAIzC
31+
=======
32+
MIIE1DCCArwCCQDMMwGnSuK0tTANBgkqhkiG9w0BAQsFADAsMRswGQYDVQQKExJE
33+
b2NrZXIgQm9pbGVycGxhdGUxDTALBgNVBAMUBCoudm0wHhcNMTUwNTA0MTcxNDQw
34+
WhcNMjUwNTAxMTcxNDQwWjAsMRswGQYDVQQKExJEb2NrZXIgQm9pbGVycGxhdGUx
35+
DTALBgNVBAMUBCoudm0wggIiMA0GCSqGSIb3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