Skip to content

Commit a87e7c6

Browse files
committed
Merge branch 'release/3.4.0'
# Conflicts: # README.md
2 parents 3a8448a + ed4c157 commit a87e7c6

29 files changed

+513
-307
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
TYPO3 Docker Boilerplate Changelog
22
==================================
33

4+
3.4.0 - 2015-06-15
5+
-------------------------------------
6+
- Renamed `PHP_UID` and `PHP_GID` to `EFFECTIVE_UID` and `EFFECTIVE_GID`
7+
- Set Apache HTTPd and Nginx UID to `EFFECTIVE_UID` and `EFFECTIVE_GID`
8+
- Renamed `make deploy` to `make build` (was confusing)
9+
- Fixed MySQL default charset (set to utf8)
10+
- Added `MYSQL_USER`, `MYSQL_PASSWORD`, `MYSQL_ROOT_USER`, `MYSQL_ROOT_PASSWORD` and `MYSQL_DATABASE` for nginx/apache/php-fpm
11+
- Improved customization of `php.ini`
12+
- Improved documentation
13+
- Added php memcache and memcached
14+
415
3.3.1 - 2015-05-11
516
-------------------------------------
617
- Fixed ssl certificate

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ARGS = $(filter-out $@,$(MAKECMDGOALS))
22

3-
all: deploy
3+
all: build
44

55
#############################
66
# Create new project
@@ -40,8 +40,8 @@ solr-restore:
4040
backup: mysql-backup solr-backup
4141
restore: mysql-restore solr-restore
4242

43-
deploy:
44-
bash bin/deploy.sh
43+
build:
44+
bash bin/build.sh
4545

4646
clean:
4747
test -d code/typo3temp && { rm -rf code/typo3temp/*; }

README.md

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

3-
![latest v3.3.1](https://img.shields.io/badge/latest-v3.3.1-green.svg?style=flat)
3+
![latest v3.4.0](https://img.shields.io/badge/latest-v3.4.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")
@@ -26,249 +26,32 @@ Configuration of each docker container is available in the `docker/` directory -
2626
This boilerplate can also be used for any other web project eg. Symfony, Magento and more.
2727
Just customize the makefile for your needs
2828

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.
29+
Warning: There may be issues when using it in production - if you have any success stories please contact me.
3030

3131
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`
3232

33-
## Requirements
33+
## Table of contents
3434

35-
- GNU/Linux with Docker (recommendation: Vagrant VM with Docker or native Linux with Docker)
36-
- make
37-
- [composer](https://getcomposer.org/)
38-
- [docker-compose](https://github.com/docker/compose)
39-
40-
If you want to run a Docker VM make sure you're using VMware or Parallels Desktop because of
41-
the much faster virtualisation (networking, disk access, shared folders) compared to VirtualBox.
42-
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)
44-
45-
## Docker short introduction
46-
47-
Create and start containers (eg. first start):
48-
49-
$ docker-compose up -d
50-
51-
Stop containers
52-
53-
$ docker-compose stop
54-
55-
Start containers (only stopped containers)
56-
57-
$ docker-compose start
58-
59-
Build (but not create and start) containers
60-
61-
$ docker-compose build --no-cache
62-
63-
Delete container content
64-
65-
$ docker-compose rm --force
66-
67-
Recreate containers (if there is any issue or just to start from a clean build)
68-
69-
$ docker-compose stop
70-
$ docker-compose rm --force
71-
$ docker-compose build --no-cache
72-
$ docker-compose up -d
73-
74-
Logs (eg. for debugging)
75-
76-
$ docker-compose logs
77-
78-
# or only php
79-
$ docker-compose logs main
80-
81-
# or only php and webserver
82-
$ docker-compose logs main web
83-
84-
CLI script (defined in docker-env.yml)
85-
86-
$ docker-compose run --rm main cli help
87-
88-
89-
## Create project
90-
91-
First create and run the Docker containers using [docker-compose](https://github.com/docker/compose):
92-
93-
$ docker-compose up -d
94-
95-
Now create the project:
96-
97-
- [Create new TYPO3 project](doc/README-TYPO3.md)
98-
- [Create new NEOS project](doc/README-NEOS.md)
99-
- [Create new Symfony project](doc/README-SYMFONY.md)
100-
- [Running any other php based project](doc/README-OTHER.md)
101-
- [Running existing project](doc/README-EXISTING.md)
102-
103-
For an existing project just put your files into `code/` folder or use git to clone your project into `code/`.
104-
105-
106-
## Informations
107-
108-
### Docker layout
109-
110-
Container | Description
111-
------------------------- | -------------------------------
112-
main | Main container with PHP-FPM and tools (your entrypoint for bash, php and other stuff)
113-
storage | Storage container, eg. for Solr data
114-
web | Apache HTTPD or Nginx webserver
115-
mysql | MySQL database
116-
solr (optional) | Apache Solr server
117-
elasticsearch (optional) | Elasticsearch server
118-
memcached (optional) | Memcached server
119-
redis (optional) | Redis server
120-
121-
This directory will be mounted under `/docker` in `main` and `web` container.
122-
123-
### Makefile
124-
125-
Customize the [Makefile](Makefile) for your needs.
126-
127-
Command | Description
128-
------------------------- | -------------------------------
129-
make bash | Enter main container with bash (user www-data)
130-
make root | Enter main container with bash (user root)
131-
<br> |
132-
make backup | General backup (run all backup tasks)
133-
make restore | General restore (run all restore tasks)
134-
<br> |
135-
make mysql-backup | Backup MySQL databases
136-
make mysql-restore | Restore MySQL databases
137-
<br> |
138-
make solr-backup | Backup Solr cores
139-
make solr-restore | Restore Solr cores
140-
<br> |
141-
make create-cms-project | Create new TYPO3 project (based on typo3/cms-base-distribution)
142-
make create-neos-project | Create new NEOS project (based on typo3/neos-base-distribution)
143-
<br> |
144-
make deploy | Run deployment (composer, gulp, bower)
145-
make scheduler | Run TYPO3 scheduler
146-
make clean | Clear TYPO3 configuration cache
147-
148-
### Web (Nginx or Apache HTTPd)
149-
150-
Setting | Value
151-
------------- | -------------
152-
Host | web:80 and web:443 (ssl)
153-
External Port | 8000 and 8443 (ssl)
154-
155-
### MySQL
156-
157-
You can choose between [MySQL](https://www.mysql.com/) (default), [MariaDB](https://www.mariadb.org/)
158-
and [PerconaDB](http://www.percona.com/software) in `docker/mysql/Dockerfile`
159-
160-
Setting | Value
161-
------------- | -------------
162-
User | dev (if not changed in env)
163-
Password | dev (if not changed in env)
164-
Database | typo3 (if not changed in env)
165-
Host | mysql:3306
166-
External Port | 13306
167-
168-
Access fo MySQL user "root" and "dev" will be allowed from external hosts (eg. for debugging, dumps and other stuff).
169-
170-
171-
### Solr
172-
173-
Setting | Value
174-
------------- | -------------
175-
Host | solr:8983
176-
External Port | 18983
177-
Cores | docker/solr/conf/solr.xml (data dirs are created automatically)
178-
179-
### Elasticsearch (disabled by default)
180-
181-
Setting | Value
182-
------------- | -------------
183-
Host | elasticsearch:9200 and :9300
184-
External Port | 19200 and 19300
185-
186-
### Redis
187-
188-
Setting | Value
189-
------------- | -------------
190-
Host | redis
191-
Port | 6379
192-
193-
### Memcached
194-
195-
Setting | Value
196-
------------- | -------------
197-
Host | memcached
198-
Port | 11211
199-
200-
### Mailcatcher
201-
202-
Setting | Value
203-
------------- | -------------
204-
Host | mail
205-
SMTP port | 1025
206-
Web port | 1080
207-
208-
### Environment settings
209-
210-
Environment | Description
211-
--------------------- | -------------
212-
DOCUMENT_ROOT | Document root for Nginx and Apache HTTPD, can be absolute or relative (to /docker inside the container).
213-
DOCUMENT_INDEX | Default document index file for Nginx and Apache HTTPd
214-
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)
216-
<br> |
217-
TYPO3_CONTEXT | Context for TYPO3, can be used for TypoScript conditions and AdditionalConfiguration
218-
FLOW_CONTEXT | Context for FLOW and NEOS
219-
<br> |
220-
MAIL_GATEWAY | Upstream server for sending mails (ssmtp)
221-
DNS_DOMAIN | List of wildcard domains pointing to webserver (eg. for local content fetching)
222-
<br> |
223-
MYSQL_ROOT_PASSWORD | Password for MySQL user "root"
224-
MYSQL_USER | Initial created MySQL user
225-
MYSQL_PASSWORD | Password for initial MySQL user
226-
MYSQL_DATABASE | Initial created MySQL database
227-
<br> |
228-
PHP_TIMEZONE | Timezone (date.timezone) setting for PHP (cli and fpm)
229-
PHP_UID | Effective UID for www-data (cli and fpm)
230-
PHP_GID | Effective GID for www-data (cli and fpm)
231-
232-
### Xdebug Remote debugger (PhpStorm)
233-
234-
Add a server (Preferences -> PHP -> Servers):
235-
236-
Setting | Value
237-
----------------------- | -------------
238-
Hostname | IP or Hostname of VM
239-
Port | 8000
240-
Use path mappings | Check
241-
Path mapping of code | /docker/code/
242-
243-
Add a debug connection (Run -> Edit -> Connections) and create a new connection.
244-
245-
Setting | Value
246-
--------------------- | -------------
247-
Server | Server you created before
248-
Start URL | /
249-
Browser | Choose one
250-
251-
Save, set a break point and test the debugger.
252-
253-
## Application cache
254-
255-
Symlink your application cache (eg. typo3temp/) to `/data/cache/` and it will be stored inside the `storage` container
256-
so it will be accessable within all containers (eg. web or main).
257-
258-
## Advanced usage (git)
259-
260-
Use this boilerplate as template and customize it for each project. Put this Docker
261-
configuration for each project into seperate git repositories.
262-
263-
Now set your existing project repository to be a git submodule in `code/`.
264-
Every developer now needs only to clone the Docker repository with `--recursive` option
265-
to get both, the Docker configuration and the TYPO3 installation.
266-
267-
For better useability track a whole branch (eg. develop or master) as submodule and not just a single commit.
35+
- [Installation and requirements](/documentation/INSTALL.md)
36+
- [Updating docker boilerplate](/documentation/UPDATE.md)
37+
- [Docker Quickstart](/documentation/DOCKER-QUICKSTART.md)
38+
- [Run your project](/documentation/DOCKER-STARTUP.md)
39+
- [Container detail info](/documentation/DOCKER-INFO.md)
40+
- [Troubleshooting](/documentation/TROUBLESHOOTING.md)
41+
- [Changelog](/CHANGELOG.md)
26842

26943
## Credits
27044

27145
This Docker layout is based on https://github.com/denderello/symfony-docker-example/
27246

273-
Thanks to [cron IT GmbH](http://www.cron.eu/) for the inspiration for this Docker boilerplate.
274-
Also thanks to [Ingo Pfennigstorf](https://twitter.com/krautsock) and [Florian Tatzel](https://twitter.com/PanadeEdu) for testing and some usefull ideas.
47+
Thanks for support, ideas and issues ...
48+
- [Ingo Pfennigstorf](https://github.com/ipf)
49+
- [Florian Tatzel](https://github.com/PanadeEdu)
50+
- [Josef Florian Glatz](https://github.com/jousch)
51+
- [Ingo Müller](https://github.com/IngoMueller)
52+
- [Benjamin Rau](https://twitter.com/benjamin_rau)
53+
- [Philipp Kitzberger](https://github.com/Kitzberger)
54+
55+
Thanks to [cron IT GmbH](http://www.cron.eu/) for inspiration.
56+
57+
Did I forget anyone? Send me a tweet or create pull request!

bin/.config.sh

100644100755
File mode changed.

bin/backup.sh

100644100755
File mode changed.
File renamed without changes.

bin/create-project.sh

100644100755
File mode changed.

bin/restore.sh

100644100755
File mode changed.

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ main:
2626
# Webserver
2727
#######################################
2828
web:
29-
#build: docker/httpd/
30-
build: docker/nginx/
29+
build: docker/httpd/
30+
#build: docker/nginx/
3131
ports:
3232
- 8000:80
3333
- 8443:443

docker-env.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ MYSQL_DATABASE=typo3
3737

3838
# PHP Settings
3939
PHP_TIMEZONE=UTC
40-
PHP_UID=1000
41-
PHP_GID=1000
40+
41+
# Permission settings
42+
EFFECTIVE_UID=1000
43+
EFFECTIVE_GID=1000
4244

4345
# Default cli user (should be www-data)
4446
CLI_USER=www-data

docker/httpd/conf/vhost.conf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ SetEnv TYPO3_CONTEXT "<TYPO3_CONTEXT>"
2929
SetEnv FLOW_CONTEXT "<FLOW_CONTEXT>"
3030
SetEnv FLOW_REWRITEURLS "<FLOW_REWRITEURLS>"
3131

32+
SetEnv MYSQL_USER "<MYSQL_USER>"
33+
SetEnv MYSQL_PASSWORD "<MYSQL_PASSWORD>"
34+
SetEnv MYSQL_ROOT_USER "root"
35+
SetEnv MYSQL_ROOT_PASSWORD "<MYSQL_ROOT_PASSWORD>"
36+
SetEnv MYSQL_DATABASE "<MYSQL_DATABASE>"
37+
3238
DirectoryIndex <DOCUMENT_INDEX> index.html index.htm
3339

3440
DocumentRoot "<DOCUMENT_ROOT>"

docker/httpd/entrypoint.sh

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/bin/bash
22

3+
###################
4+
# UID/GID
5+
###################
6+
7+
## Set uid/gid for www-data user
8+
usermod --uid "${EFFECTIVE_UID}" --shell /bin/bash --home /home daemon > /dev/null
9+
groupmod --gid "${EFFECTIVE_GID}" daemon > /dev/null
10+
311
###################
412
# httpd.conf
513
###################
@@ -29,15 +37,22 @@ for DOMAIN in $DNS_DOMAIN; do
2937
ALIAS_DOMAIN="${ALIAS_DOMAIN} *.${DOMAIN}"
3038
done
3139

32-
cp /usr/local/apache2/conf/.docker-vhost.conf.original /usr/local/apache2/conf/docker-vhost.conf
33-
/bin/sed -i "s@<DOCUMENT_ROOT>@${DOCUMENT_ROOT}@" /usr/local/apache2/conf/docker-vhost.conf
34-
/bin/sed -i "s@<DOCUMENT_INDEX>@${DOCUMENT_INDEX}@" /usr/local/apache2/conf/docker-vhost.conf
35-
/bin/sed -i "s@<TYPO3_CONTEXT>@${TYPO3_CONTEXT}@" /usr/local/apache2/conf/docker-vhost.conf
36-
/bin/sed -i "s@<FLOW_CONTEXT>@${FLOW_CONTEXT}@" /usr/local/apache2/conf/docker-vhost.conf
37-
/bin/sed -i "s@<FLOW_REWRITEURLS>@${FLOW_REWRITEURLS}@" /usr/local/apache2/conf/docker-vhost.conf
38-
/bin/sed -i "s@<FPM_HOST>@${MAIN_PORT_9000_TCP_ADDR}@" /usr/local/apache2/conf/docker-vhost.conf
39-
/bin/sed -i "s@<FPM_PORT>@${MAIN_PORT_9000_TCP_PORT}@" /usr/local/apache2/conf/docker-vhost.conf
40-
/bin/sed -i "s@<ALIAS_DOMAIN>@${ALIAS_DOMAIN}@" /usr/local/apache2/conf/docker-vhost.conf
40+
cp /usr/local/apache2/conf/.docker-vhost.conf.original /usr/local/apache2/conf/docker-vhost.conf
41+
/bin/sed -i "s@<DOCUMENT_ROOT>@${DOCUMENT_ROOT}@" /usr/local/apache2/conf/docker-vhost.conf
42+
/bin/sed -i "s@<DOCUMENT_INDEX>@${DOCUMENT_INDEX}@" /usr/local/apache2/conf/docker-vhost.conf
43+
/bin/sed -i "s@<ALIAS_DOMAIN>@${ALIAS_DOMAIN}@" /usr/local/apache2/conf/docker-vhost.conf
44+
45+
/bin/sed -i "s@<TYPO3_CONTEXT>@${TYPO3_CONTEXT}@" /usr/local/apache2/conf/docker-vhost.conf
46+
/bin/sed -i "s@<FLOW_CONTEXT>@${FLOW_CONTEXT}@" /usr/local/apache2/conf/docker-vhost.conf
47+
/bin/sed -i "s@<FLOW_REWRITEURLS>@${FLOW_REWRITEURLS}@" /usr/local/apache2/conf/docker-vhost.conf
48+
49+
/bin/sed -i "s@<FPM_HOST>@${MAIN_PORT_9000_TCP_ADDR}@" /usr/local/apache2/conf/docker-vhost.conf
50+
/bin/sed -i "s@<FPM_PORT>@${MAIN_PORT_9000_TCP_PORT}@" /usr/local/apache2/conf/docker-vhost.conf
51+
52+
/bin/sed -i "s@<MYSQL_USER>@${MYSQL_USER}@" /usr/local/apache2/conf/docker-vhost.conf
53+
/bin/sed -i "s@<MYSQL_PASSWORD>@${MYSQL_PASSWORD}@" /usr/local/apache2/conf/docker-vhost.conf
54+
/bin/sed -i "s@<MYSQL_ROOT_PASSWORD>@${MYSQL_ROOT_PASSWORD}@" /usr/local/apache2/conf/docker-vhost.conf
55+
/bin/sed -i "s@<MYSQL_DATABASE>@${MYSQL_DATABASE}@" /usr/local/apache2/conf/docker-vhost.conf
4156

4257
#############################
4358
## COMMAND

0 commit comments

Comments
 (0)