Skip to content

Commit f76625b

Browse files
committed
Merge branch 'release/5.0.0'
# Conflicts: # documentation/INSTALL.md
2 parents a67f865 + d9b8ece commit f76625b

File tree

156 files changed

+1409
-2394
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+1409
-2394
lines changed

.dockerignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
*.md
2+
.git*
3+
backup/*
4+
bin/*
5+
app/*
6+
docker/*
7+
documentation/*

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
.idea
33
nbproject
44
/backup/*
5-
/code/*
5+
/app/*
6+
/docker-compose.yml

CHANGELOG.md

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

4+
5.1.0 - UPCOMING
5+
----------------
6+
7+
5.0.0 - 2016-03-07
8+
------------------
9+
- Refactored with new `webdevops/base` images
10+
- Faster creation/startup times
11+
- Ansible provisioning
12+
- Real production and development provisioning
13+
- Added cloud support (without host mounted volumes)
14+
- Moved `code/` to `app/` (Moved `/application/code` to `/app` inside Docker container)
15+
- Renamed `main` to `app` container
16+
17+
4.1.0 - canceled
18+
------------------
19+
- Added cron
20+
- Improved documentation
21+
- Splitted MySQL Dockerfiles (with version and fork - MySQL, MariaDB and Percona)
22+
- Fixed slow shutdown of storage (thanks to Stephan Ferraro)
23+
- Added MySQL host and port as environment variables
24+
425
4.0.0 - 2015-08-17
526
------------------
627
- Seperated TYPO3 Docker Boilerplate and PHP Docker Boilerplate

Dockerfile.cloud

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#++++++++++++++++++++++++++++++++++++++
2+
# PHP application Docker container
3+
#++++++++++++++++++++++++++++++++++++++
4+
#
5+
# PHP-Versions:
6+
# ubuntu-12.04 -> PHP 5.3 (precise) LTS
7+
# ubuntu-14.04 -> PHP 5.5 (trusty) LTS
8+
# ubuntu-15.04 -> PHP 5.6 (vivid)
9+
# ubuntu-15.10 -> PHP 5.6 (wily)
10+
# ubuntu-16.04 -> PHP 5.6 and 7.0 (xenial) LTS
11+
# centos-7 -> PHP 5.4
12+
# debian-7 -> PHP 5.4 (wheezy)
13+
# debian-8 -> PHP 5.6 and 7.x (jessie)
14+
# debian-9 -> PHP 5.6 and 7.0 (stretch)
15+
#
16+
# Apache:
17+
# webdevops/php-apache:ubuntu-12.04
18+
# webdevops/php-apache:ubuntu-14.04
19+
# webdevops/php-apache:ubuntu-15.04
20+
# webdevops/php-apache:ubuntu-15.10
21+
# webdevops/php-apache:ubuntu-16.04
22+
# webdevops/php-apache:ubuntu-16.04-php7
23+
# webdevops/php-apache:centos-7
24+
# webdevops/php-apache:debian-7
25+
# webdevops/php-apache:debian-8
26+
# webdevops/php-apache:debian-8-php7
27+
# webdevops/php-apache:debian-9
28+
# webdevops/php-apache:debian-9-php7
29+
#
30+
# Nginx:
31+
# webdevops/php-nginx:ubuntu-12.04
32+
# webdevops/php-nginx:ubuntu-14.04
33+
# webdevops/php-nginx:ubuntu-15.04
34+
# webdevops/php-nginx:ubuntu-15.10
35+
# webdevops/php-nginx:ubuntu-16.04
36+
# webdevops/php-nginx:ubuntu-16.04-php7
37+
# webdevops/php-nginx:centos-7
38+
# webdevops/php-nginx:debian-7
39+
# webdevops/php-nginx:debian-8
40+
# webdevops/php-nginx:debian-8-php7
41+
# webdevops/php-nginx:debian-9
42+
# webdevops/php-nginx:debian-9-php7
43+
#
44+
# HHVM:
45+
# webdevops/hhvm-apache
46+
# webdevops/hhvm-nginx
47+
#
48+
#++++++++++++++++++++++++++++++++++++++
49+
50+
FROM webdevops/php-apache:ubuntu-14.04
51+
52+
ENV PROVISION_CONTEXT "production"
53+
54+
# Deploy scripts/configurations
55+
COPY etc/ /opt/docker/etc/
56+
COPY provision/ /opt/docker/provision/
57+
58+
COPY app/ /app/
59+
60+
RUN /opt/docker/bin/control.sh provision.role.startup boilerplate-main \
61+
&& /opt/docker/bin/control.sh provision.role.startup boilerplate-deployment \
62+
&& /opt/docker/bin/bootstrap.sh
63+
64+
# Configure volume/workdir
65+
RUN mkdir -p /app/
66+
WORKDIR /app/

Dockerfile.development

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#++++++++++++++++++++++++++++++++++++++
2+
# PHP application Docker container
3+
#++++++++++++++++++++++++++++++++++++++
4+
#
5+
# PHP-Versions:
6+
# ubuntu-12.04 -> PHP 5.3 (precise) LTS
7+
# ubuntu-14.04 -> PHP 5.5 (trusty) LTS
8+
# ubuntu-15.04 -> PHP 5.6 (vivid)
9+
# ubuntu-15.10 -> PHP 5.6 (wily)
10+
# ubuntu-16.04 -> PHP 5.6 and 7.0 (xenial) LTS
11+
# centos-7 -> PHP 5.4
12+
# debian-7 -> PHP 5.4 (wheezy)
13+
# debian-8 -> PHP 5.6 and 7.x (jessie)
14+
# debian-9 -> PHP 5.6 and 7.0 (stretch)
15+
#
16+
# Apache:
17+
# webdevops/php-apache:ubuntu-12.04
18+
# webdevops/php-apache:ubuntu-14.04
19+
# webdevops/php-apache:ubuntu-15.04
20+
# webdevops/php-apache:ubuntu-15.10
21+
# webdevops/php-apache:ubuntu-16.04
22+
# webdevops/php-apache:ubuntu-16.04-php7
23+
# webdevops/php-apache:centos-7
24+
# webdevops/php-apache:debian-7
25+
# webdevops/php-apache:debian-8
26+
# webdevops/php-apache:debian-8-php7
27+
# webdevops/php-apache:debian-9
28+
# webdevops/php-apache:debian-9-php7
29+
#
30+
# Nginx:
31+
# webdevops/php-nginx:ubuntu-12.04
32+
# webdevops/php-nginx:ubuntu-14.04
33+
# webdevops/php-nginx:ubuntu-15.04
34+
# webdevops/php-nginx:ubuntu-15.10
35+
# webdevops/php-nginx:ubuntu-16.04
36+
# webdevops/php-nginx:ubuntu-16.04-php7
37+
# webdevops/php-nginx:centos-7
38+
# webdevops/php-nginx:debian-7
39+
# webdevops/php-nginx:debian-8
40+
# webdevops/php-nginx:debian-8-php7
41+
# webdevops/php-nginx:debian-9
42+
# webdevops/php-nginx:debian-9-php7
43+
#
44+
# HHVM:
45+
# webdevops/hhvm-apache
46+
# webdevops/hhvm-nginx
47+
#
48+
#++++++++++++++++++++++++++++++++++++++
49+
50+
FROM webdevops/php-apache:ubuntu-14.04
51+
52+
ENV PROVISION_CONTEXT "development"
53+
54+
# Deploy scripts/configurations
55+
COPY etc/ /opt/docker/etc/
56+
COPY provision/ /opt/docker/provision/
57+
58+
RUN /opt/docker/bin/control.sh provision.role boilerplate-main \
59+
&& /opt/docker/bin/control.sh provision.role boilerplate-main-development \
60+
&& /opt/docker/bin/control.sh provision.role.startup boilerplate-deployment \
61+
&& /opt/docker/bin/bootstrap.sh
62+
63+
# Configure volume/workdir
64+
RUN mkdir -p /app/
65+
WORKDIR /app/

Dockerfile.production

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#++++++++++++++++++++++++++++++++++++++
2+
# PHP application Docker container
3+
#++++++++++++++++++++++++++++++++++++++
4+
#
5+
# PHP-Versions:
6+
# ubuntu-12.04 -> PHP 5.3 (precise) LTS
7+
# ubuntu-14.04 -> PHP 5.5 (trusty) LTS
8+
# ubuntu-15.04 -> PHP 5.6 (vivid)
9+
# ubuntu-15.10 -> PHP 5.6 (wily)
10+
# ubuntu-16.04 -> PHP 5.6 and 7.0 (xenial) LTS
11+
# centos-7 -> PHP 5.4
12+
# debian-7 -> PHP 5.4 (wheezy)
13+
# debian-8 -> PHP 5.6 and 7.x (jessie)
14+
# debian-9 -> PHP 5.6 and 7.0 (stretch)
15+
#
16+
# Apache:
17+
# webdevops/php-apache:ubuntu-12.04
18+
# webdevops/php-apache:ubuntu-14.04
19+
# webdevops/php-apache:ubuntu-15.04
20+
# webdevops/php-apache:ubuntu-15.10
21+
# webdevops/php-apache:ubuntu-16.04
22+
# webdevops/php-apache:ubuntu-16.04-php7
23+
# webdevops/php-apache:centos-7
24+
# webdevops/php-apache:debian-7
25+
# webdevops/php-apache:debian-8
26+
# webdevops/php-apache:debian-8-php7
27+
# webdevops/php-apache:debian-9
28+
# webdevops/php-apache:debian-9-php7
29+
#
30+
# Nginx:
31+
# webdevops/php-nginx:ubuntu-12.04
32+
# webdevops/php-nginx:ubuntu-14.04
33+
# webdevops/php-nginx:ubuntu-15.04
34+
# webdevops/php-nginx:ubuntu-15.10
35+
# webdevops/php-nginx:ubuntu-16.04
36+
# webdevops/php-nginx:ubuntu-16.04-php7
37+
# webdevops/php-nginx:centos-7
38+
# webdevops/php-nginx:debian-7
39+
# webdevops/php-nginx:debian-8
40+
# webdevops/php-nginx:debian-8-php7
41+
# webdevops/php-nginx:debian-9
42+
# webdevops/php-nginx:debian-9-php7
43+
#
44+
# HHVM:
45+
# webdevops/hhvm-apache
46+
# webdevops/hhvm-nginx
47+
#
48+
#++++++++++++++++++++++++++++++++++++++
49+
50+
FROM webdevops/php-apache:ubuntu-14.04
51+
52+
ENV PROVISION_CONTEXT "production"
53+
54+
# Deploy scripts/configurations
55+
COPY etc/ /opt/docker/etc/
56+
COPY provision/ /opt/docker/provision/
57+
58+
RUN /opt/docker/bin/control.sh provision.role boilerplate-main \
59+
&& /opt/docker/bin/control.sh provision.role.startup boilerplate-deployment \
60+
&& /opt/docker/bin/bootstrap.sh
61+
62+
# Configure volume/workdir
63+
RUN mkdir -p /app/
64+
WORKDIR /app/

LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
The MIT License (MIT)
22

3+
Copyright (c) 2015 WebDevOps
34
Copyright (c) 2015 Markus Blaschke
45

56
Permission is hereby granted, free of charge, to any person obtaining a copy

Makefile

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
ARGS = $(filter-out $@,$(MAKECMDGOALS))
2+
MAKEFLAGS += --silent
23

3-
all: build
4+
list:
5+
sh -c "echo; $(MAKE) -p no_targets__ | awk -F':' '/^[a-zA-Z0-9][^\$$#\/\\t=]*:([^=]|$$)/ {split(\$$1,A,/ /);for(i in A)print A[i]}' | grep -v '__\$$' | grep -v 'Makefile'| sort"
46

57
#############################
68
# Create new project
@@ -9,28 +11,50 @@ all: build
911
create:
1012
bash bin/create-project.sh $(ARGS)
1113

14+
#############################
15+
# Docker machine states
16+
#############################
17+
18+
up:
19+
docker-compose up -d
20+
21+
start:
22+
docker-compose start
23+
24+
stop:
25+
docker-compose stop
26+
27+
state:
28+
docker-compose ps
29+
30+
rebuild:
31+
docker-compose stop
32+
docker-compose rm --force app
33+
docker-compose build --no-cache
34+
docker-compose up -d
35+
1236
#############################
1337
# MySQL
1438
#############################
1539

1640
mysql-backup:
17-
docker-compose run --rm --no-deps main root bash /docker/bin/backup.sh mysql
41+
docker-compose run --rm --no-deps app root bash /docker/bin/backup.sh mysql
1842

1943
mysql-restore:
20-
docker-compose run --rm --no-deps main root bash /docker/bin/restore.sh mysql
44+
docker-compose run --rm --no-deps app root bash /docker/bin/restore.sh mysql
2145

2246
#############################
2347
# Solr
2448
#############################
2549

2650
solr-backup:
2751
docker-compose stop solr
28-
docker-compose run --rm --no-deps main root bash /docker/bin/backup.sh solr
52+
docker-compose run --rm --no-deps app root bash /docker/bin/backup.sh solr
2953
docker-compose start solr
3054

3155
solr-restore:
3256
docker-compose stop solr
33-
docker-compose run --rm --no-deps main root bash /docker/bin/restore.sh solr
57+
docker-compose run --rm --no-deps app root bash /docker/bin/restore.sh solr
3458
docker-compose start solr
3559

3660
#############################
@@ -43,21 +67,11 @@ restore: mysql-restore solr-restore
4367
build:
4468
bash bin/build.sh
4569

46-
clean:
47-
test -d code/typo3temp && { rm -rf code/typo3temp/*; }
48-
4970
bash:
50-
docker-compose run --rm main bash
71+
docker-compose run --rm app bash
5172

5273
root:
53-
docker-compose run --rm main root
54-
55-
#############################
56-
# TYPO3
57-
#############################
58-
59-
scheduler:
60-
docker-compose run --rm main typo3/cli_dispatch.phpsh scheduler $(ARGS)
74+
docker-compose run --rm app root
6175

6276
#############################
6377
# Argument fix workaround

README.md

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

3-
[![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)
3+
[![latest v5.0.0](https://img.shields.io/badge/latest-v5.0.0-green.svg?style=flat)](https://github.com/webdevops/php-docker-boilerplate/releases/tag/5.0.0)
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/php-docker-boilerplate.svg)](http://isitmaintained.com/project/mblaschke/php-docker-boilerplate "Average time to resolve an issue")
66
[![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")
77

8-
This is an easy customizable docker boilerplate for any PHP based projects like _Symfony Framework_, _CakePHP_, _Yii_ and many other frameworks or applications.
8+
This is an easy customizable docker boilerplate for any PHP-based projects like _Symfony Framework_, _CakePHP_, _Yii_ and many other frameworks or applications.
99

1010
Supports:
1111

@@ -21,19 +21,19 @@ Supports:
2121
- FTP server (vsftpd)
2222
- maybe more later...
2323

24-
This Docker boilerplate based on the best practises and don't use too much magic.
25-
Configuration of each docker container is available in the `docker/` directory - feel free to customize.
24+
This Docker boilerplate is based on the [Docker best practices](https://docs.docker.com/articles/dockerfile_best-practices/) and doesn't use too much magic. Configuration of each docker container is available in the `docker/` directory - feel free to customize.
2625

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

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

32-
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`
30+
If you have any success stories please contact me.
31+
32+
You can use my [Vagrant Development VM](https://github.com/mblaschke/vagrant-development) for this Docker boilerplate, e.g. for easily creating new boilerplate installations with short shell command: `ct docker:create directory`.
3333

3434
## Table of contents
3535

36-
- [Installation and requirements](/documentation/INSTALL.md)
36+
- [First steps / Installation and requirements](/documentation/INSTALL.md)
3737
- [Updating docker boilerplate](/documentation/UPDATE.md)
3838
- [Customizing](/documentation/CUSTOMIZE.md)
3939
- [Services (Webserver, MySQL... Ports, Users, Passwords)](/documentation/SERVICES.md)
@@ -47,13 +47,17 @@ You can use my [Vagrant Development VM](https://github.com/mblaschke/vagrant-dev
4747

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

50-
Thanks for support, ideas and issues ...
50+
Thanks for your support, ideas and issues.
5151
- [Ingo Pfennigstorf](https://github.com/ipf)
5252
- [Florian Tatzel](https://github.com/PanadeEdu)
5353
- [Josef Florian Glatz](https://github.com/jousch)
5454
- [Ingo Müller](https://github.com/IngoMueller)
5555
- [Benjamin Rau](https://twitter.com/benjamin_rau)
5656
- [Philipp Kitzberger](https://github.com/Kitzberger)
57+
- [Stephan Ferraro](https://github.com/ferraro)
58+
- [Cedric Ziel](https://github.com/cedricziel)
59+
- [Elmar Hinz](https://github.com/elmar-hinz)
60+
5761

5862
Thanks to [cron IT GmbH](http://www.cron.eu/) for inspiration.
5963

File renamed without changes.

0 commit comments

Comments
 (0)