1
1
# Dockerized PHP web project boilerplate
2
2
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 )
4
4
![ License MIT] ( https://img.shields.io/badge/license-MIT-blue.svg?style=flat )
5
5
[ ![ 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 ")
6
6
[ ![ 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 -
26
26
This boilerplate can also be used for any other web project eg. Symfony, Magento and more.
27
27
Just customize the makefile for your needs
28
28
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.
30
30
31
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 `
32
32
33
- ## Requirements
33
+ ## Table of contents
34
34
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 )
268
42
269
43
## Credits
270
44
271
45
This Docker layout is based on https://github.com/denderello/symfony-docker-example/
272
46
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!
0 commit comments