Skip to content

Commit 53ea76d

Browse files
committed
Merge branch 'php-docker-boilerplate' into develop
# Conflicts: # documentation/PROJECT-SYMFONY.md # etc/environment.yml
2 parents 70eee91 + 302c511 commit 53ea76d

25 files changed

+113
-61
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ PHP Docker Boilerplate Changelog
88
- Ansible provisioning
99
- Real production and development provisioning
1010
- Added cloud support (without host mounted volumes)
11+
- Moved `code/` to `app/` (Moved `/application/code` to `/app` inside Docker container)
1112

1213
4.1.0 - canceled
1314
------------------

Dockerfile.cloud

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,43 @@
33
#++++++++++++++++++++++++++++++++++++++
44
#
55
# PHP-Versions:
6-
# ubuntu-12.04 -> PHP 5.3, LTS (precise)
7-
# ubuntu-14.04 -> PHP 5.5, LTS (trusty)
8-
# ubuntu-15.04 -> PHP 5.6 (vivid)
9-
# ubuntu-15.10 -> PHP 5.6 (wily)
10-
# centos-7 -> PHP 5.4
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)
1115
#
1216
# Apache:
1317
# webdevops/php-apache:ubuntu-12.04
1418
# webdevops/php-apache:ubuntu-14.04
1519
# webdevops/php-apache:ubuntu-15.04
1620
# webdevops/php-apache:ubuntu-15.10
21+
# webdevops/php-apache:ubuntu-16.04
22+
# webdevops/php-apache:ubuntu-16.04-php7
1723
# webdevops/php-apache:centos-7
1824
# webdevops/php-apache:debian-7
1925
# webdevops/php-apache:debian-8
2026
# webdevops/php-apache:debian-8-php7
27+
# webdevops/php-apache:debian-9
28+
# webdevops/php-apache:debian-9-php7
2129
#
2230
# Nginx:
2331
# webdevops/php-nginx:ubuntu-12.04
2432
# webdevops/php-nginx:ubuntu-14.04
2533
# webdevops/php-nginx:ubuntu-15.04
2634
# webdevops/php-nginx:ubuntu-15.10
35+
# webdevops/php-nginx:ubuntu-16.04
36+
# webdevops/php-nginx:ubuntu-16.04-php7
2737
# webdevops/php-nginx:centos-7
2838
# webdevops/php-nginx:debian-7
2939
# webdevops/php-nginx:debian-8
3040
# webdevops/php-nginx:debian-8-php7
41+
# webdevops/php-nginx:debian-9
42+
# webdevops/php-nginx:debian-9-php7
3143
#
3244
# HHVM:
3345
# webdevops/hhvm-apache
@@ -43,15 +55,12 @@ ENV PROVISION_CONTEXT "production"
4355
COPY etc/ /opt/docker/etc/
4456
COPY provision/ /opt/docker/provision/
4557

46-
COPY code/ /application/code/
58+
COPY app/ /app/
4759

4860
RUN /opt/docker/bin/control.sh provision.role.startup boilerplate-main \
4961
&& /opt/docker/bin/control.sh provision.role.startup boilerplate-deployment \
50-
&& /opt/docker/bin/control.sh service.enable cron \
51-
&& /opt/docker/bin/control.sh service.enable dnsmasq \
5262
&& /opt/docker/bin/bootstrap.sh
5363

5464
# Configure volume/workdir
55-
RUN mkdir -p /application/code/
56-
VOLUME /application/
57-
WORKDIR /application/code/
65+
RUN mkdir -p /app/
66+
WORKDIR /app/

Dockerfile.development

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,43 @@
33
#++++++++++++++++++++++++++++++++++++++
44
#
55
# PHP-Versions:
6-
# ubuntu-12.04 -> PHP 5.3, LTS (precise)
7-
# ubuntu-14.04 -> PHP 5.5, LTS (trusty)
8-
# ubuntu-15.04 -> PHP 5.6 (vivid)
9-
# ubuntu-15.10 -> PHP 5.6 (wily)
10-
# centos-7 -> PHP 5.4
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)
1115
#
1216
# Apache:
1317
# webdevops/php-apache:ubuntu-12.04
1418
# webdevops/php-apache:ubuntu-14.04
1519
# webdevops/php-apache:ubuntu-15.04
1620
# webdevops/php-apache:ubuntu-15.10
21+
# webdevops/php-apache:ubuntu-16.04
22+
# webdevops/php-apache:ubuntu-16.04-php7
1723
# webdevops/php-apache:centos-7
1824
# webdevops/php-apache:debian-7
1925
# webdevops/php-apache:debian-8
2026
# webdevops/php-apache:debian-8-php7
27+
# webdevops/php-apache:debian-9
28+
# webdevops/php-apache:debian-9-php7
2129
#
2230
# Nginx:
2331
# webdevops/php-nginx:ubuntu-12.04
2432
# webdevops/php-nginx:ubuntu-14.04
2533
# webdevops/php-nginx:ubuntu-15.04
2634
# webdevops/php-nginx:ubuntu-15.10
35+
# webdevops/php-nginx:ubuntu-16.04
36+
# webdevops/php-nginx:ubuntu-16.04-php7
2737
# webdevops/php-nginx:centos-7
2838
# webdevops/php-nginx:debian-7
2939
# webdevops/php-nginx:debian-8
3040
# webdevops/php-nginx:debian-8-php7
41+
# webdevops/php-nginx:debian-9
42+
# webdevops/php-nginx:debian-9-php7
3143
#
3244
# HHVM:
3345
# webdevops/hhvm-apache
@@ -46,11 +58,8 @@ COPY provision/ /opt/docker/provision/
4658
RUN /opt/docker/bin/control.sh provision.role boilerplate-main \
4759
&& /opt/docker/bin/control.sh provision.role boilerplate-main-development \
4860
&& /opt/docker/bin/control.sh provision.role.startup boilerplate-deployment \
49-
&& /opt/docker/bin/control.sh service.enable cron \
50-
&& /opt/docker/bin/control.sh service.enable dnsmasq \
51-
&& /opt/docker/bin/control.sh service.enable postfix \
5261
&& /opt/docker/bin/bootstrap.sh
5362

5463
# Configure volume/workdir
55-
RUN mkdir -p /application/code/
56-
WORKDIR /application/code/
64+
RUN mkdir -p /app/
65+
WORKDIR /app/

Dockerfile.production

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,43 @@
33
#++++++++++++++++++++++++++++++++++++++
44
#
55
# PHP-Versions:
6-
# ubuntu-12.04 -> PHP 5.3, LTS (precise)
7-
# ubuntu-14.04 -> PHP 5.5, LTS (trusty)
8-
# ubuntu-15.04 -> PHP 5.6 (vivid)
9-
# ubuntu-15.10 -> PHP 5.6 (wily)
10-
# centos-7 -> PHP 5.4
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)
1115
#
1216
# Apache:
1317
# webdevops/php-apache:ubuntu-12.04
1418
# webdevops/php-apache:ubuntu-14.04
1519
# webdevops/php-apache:ubuntu-15.04
1620
# webdevops/php-apache:ubuntu-15.10
21+
# webdevops/php-apache:ubuntu-16.04
22+
# webdevops/php-apache:ubuntu-16.04-php7
1723
# webdevops/php-apache:centos-7
1824
# webdevops/php-apache:debian-7
1925
# webdevops/php-apache:debian-8
2026
# webdevops/php-apache:debian-8-php7
27+
# webdevops/php-apache:debian-9
28+
# webdevops/php-apache:debian-9-php7
2129
#
2230
# Nginx:
2331
# webdevops/php-nginx:ubuntu-12.04
2432
# webdevops/php-nginx:ubuntu-14.04
2533
# webdevops/php-nginx:ubuntu-15.04
2634
# webdevops/php-nginx:ubuntu-15.10
35+
# webdevops/php-nginx:ubuntu-16.04
36+
# webdevops/php-nginx:ubuntu-16.04-php7
2737
# webdevops/php-nginx:centos-7
2838
# webdevops/php-nginx:debian-7
2939
# webdevops/php-nginx:debian-8
3040
# webdevops/php-nginx:debian-8-php7
41+
# webdevops/php-nginx:debian-9
42+
# webdevops/php-nginx:debian-9-php7
3143
#
3244
# HHVM:
3345
# webdevops/hhvm-apache
@@ -45,11 +57,8 @@ COPY provision/ /opt/docker/provision/
4557

4658
RUN /opt/docker/bin/control.sh provision.role boilerplate-main \
4759
&& /opt/docker/bin/control.sh provision.role.startup boilerplate-deployment \
48-
&& /opt/docker/bin/control.sh service.enable cron \
49-
&& /opt/docker/bin/control.sh service.enable dnsmasq \
50-
&& /opt/docker/bin/control.sh service.enable postfix \
5160
&& /opt/docker/bin/bootstrap.sh
5261

5362
# Configure volume/workdir
54-
RUN mkdir -p /application/code/
55-
WORKDIR /application/code/
63+
RUN mkdir -p /app/
64+
WORKDIR /app/

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,23 @@ rebuild:
3737
#############################
3838

3939
mysql-backup:
40-
docker-compose run --rm --no-deps main root bash /application/bin/backup.sh mysql
40+
docker-compose run --rm --no-deps main root bash /docker/bin/backup.sh mysql
4141

4242
mysql-restore:
43-
docker-compose run --rm --no-deps main root bash /application/bin/restore.sh mysql
43+
docker-compose run --rm --no-deps main root bash /docker/bin/restore.sh mysql
4444

4545
#############################
4646
# Solr
4747
#############################
4848

4949
solr-backup:
5050
docker-compose stop solr
51-
docker-compose run --rm --no-deps main root bash /application/bin/backup.sh solr
51+
docker-compose run --rm --no-deps main root bash /docker/bin/backup.sh solr
5252
docker-compose start solr
5353

5454
solr-restore:
5555
docker-compose stop solr
56-
docker-compose run --rm --no-deps main root bash /application/bin/restore.sh solr
56+
docker-compose run --rm --no-deps main root bash /docker/bin/restore.sh solr
5757
docker-compose start solr
5858

5959
#############################
File renamed without changes.

app/index.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php
2+
3+
phpinfo();

bin/backup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ case "$1" in
3939
fi
4040

4141
logMsg "Starting Solr backup..."
42-
tar jcPf "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" /data/solr/
42+
tar jcPf "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" /storage/solr/
4343
logMsg "Finished"
4444
;;
4545
esac

bin/restore.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ case "$1" in
3535
"solr")
3636
if [ -f "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" ]; then
3737
logMsg "Starting Solr restore..."
38-
rm -rf /data/solr/* && mkdir -p /data/solr/
39-
chmod 777 /data/solr/
38+
rm -rf /storage/solr/* && mkdir -p /storage/solr/
39+
chmod 777 /storage/solr/
4040
tar jxPf "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" -C /
4141
logMsg "Finished"
4242
else

docker-compose.cloud.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ mysql:
6969
# volumes_from:
7070
# - storage
7171
# environment:
72-
# - SOLR_STORAGE=/data/solr/server-master/
72+
# - SOLR_STORAGE=/storage/solr/server-master/
7373
# env_file:
7474
# - etc/environment.yml
7575
# - etc/environment.production.yml

docker-compose.development.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ main:
1818
- "8443:443"
1919
- "10022:22"
2020
volumes:
21-
- ./:/application/
21+
- ./app/:/app/
2222
- /tmp/debug/:/tmp/debug/
23+
- ./:/docker/
2324
volumes_from:
2425
- storage
2526
# cap and privileged needed for slowlog
@@ -75,7 +76,7 @@ mysql:
7576
# volumes_from:
7677
# - storage
7778
# environment:
78-
# - SOLR_STORAGE=/data/solr/server-master/
79+
# - SOLR_STORAGE=/storage/solr/server-master/
7980
# env_file:
8081
# - etc/environment.yml
8182
# - etc/environment.development.yml

docker-compose.production.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ main:
1818
- "8443:443"
1919
- "10022:22"
2020
volumes:
21-
- ./:/application/
21+
- ./app/:/app/
2222
volumes_from:
2323
- storage
2424
env_file:
@@ -68,7 +68,7 @@ mysql:
6868
# volumes_from:
6969
# - storage
7070
# environment:
71-
# - SOLR_STORAGE=/data/solr/server-master/
71+
# - SOLR_STORAGE=/storage/solr/server-master/
7272
# env_file:
7373
# - etc/environment.yml
7474
# - etc/environment.production.yml

docker/solr/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ RUN ln -s /opt/solr/contrib /opt/solr/example/solr/contrib
3131
# Fix rights
3232
RUN chown solr:solr -R /opt/solr/example/solr/
3333

34-
VOLUME "/data"
34+
VOLUME "/storage"
3535

3636
ENTRYPOINT ["/entrypoint.sh"]
37-
CMD ["solr"]
37+
CMD ["solr"]

documentation/DOCKER-INFO.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Hostname | IP or Hostname of VM
9191
Port | 8000
9292
Debugger | Xdebug
9393
Use path mappings | Check
94-
Path mapping of folder 'code' | /docker/code/
94+
Path mapping of folder 'app' | /app/
9595

9696
### 2.) Add a debug connection (Run -> Edit Configurations... -> Connections) and create a new configuration (PHP Web Application).
9797

@@ -105,5 +105,5 @@ Save, set a break point and test the debugger.
105105

106106
## Application cache
107107

108-
Symlink your application cache (eg. typo3temp/) to `/data/cache/` and it will be stored inside the `storage` container
108+
Symlink your application cache (eg. typo3temp/) to `/storage/cache/` and it will be stored inside the `storage` container
109109
so it will be accessible within all containers (eg. web or main).

documentation/DOCKER-STARTUP.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ Now create your project inside the docker boilerplate:
2323
- [Running any other php based project](PROJECT-OTHER.md)
2424
- [Running existing project](PROJECT-EXISTING.md)
2525

26-
For an existing project just put your files into `code/` folder or use git to clone your project into `code/`.
26+
For an existing project just put your files into `app/` folder or use git to clone your project into `app/`.
2727

2828
## Advanced usage (git)
2929

3030
Use this boilerplate as template and customize it for each project. Put this Docker
3131
configuration for each project into separate git repositories.
3232

33-
Now set your existing project repository to be a git submodule in `code/`.
33+
Now set your existing project repository to be a git submodule in `app/`.
3434
Every developer now needs only to clone the Docker repository with `--recursive` option
3535
to get both, the Docker configuration and the TYPO3 installation.
3636

documentation/INSTALL.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ the much faster virtualisation (networking, disk access, shared folders) compare
1515
There is also a [Vagrant VM for VirtualBox, VMware and Parallels](https://github.com/webdevops/vagrant-docker-vm)
1616
with a mailcatcher (Postfix with Dovecot, catches all outgoing mails).
1717

18-
_Warning:_ Boot2docker is not recommended because of slow/buggy file sharing between host and guest and there is no
19-
convenient way to access the box with Samba or SSH.
20-
This Docker boilerplate tries to avoid common anti-patterns like a Samba/SSH container because Boot2docker
21-
isn't able to handle such tasks.
22-
2318
For more convenience use [CliTools.phar](https://github.com/webdevops/clitools) (will also run on native Linux, not only inside a Vagrant box)
2419

2520
## First startup

documentation/PROJECT-EXISTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ make create git https://github..../
1212

1313
or manually
1414
```bash
15-
git clone --recursive https://github..../ code/
15+
git clone --recursive https://github..../ app/
1616
```
1717

1818
Check `DOCUMENT_ROOT` and `DOCUMENT_INDEX` in `etc/environment*.yml`

documentation/PROJECT-OTHER.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Create project
66

7-
- Put your project files into `code/`
7+
- Put your project files into `app/`
88
- If needed modify `DOCUMENT_ROOT` and `DOCUMENT_INDEX` in `etc/environment*.yml`
99
- You're done - really
1010

documentation/SERVICES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,4 @@ Host | ftp
8080
Ports | 20,21
8181
User | dev (if not changed in env)
8282
Password | dev (if not changed in env)
83-
Path | /data/ftp (if not changed in env)
83+
Path | /storage/ftp (if not changed in env)

documentation/TROUBLESHOOTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ docker-compose up -d
1616

1717
## Complete reset
1818

19-
Reset all containers, delete all data (`mysql`, `solr` ..) but not your project files in `code/`!
19+
Reset all containers, delete all data (`mysql`, `solr` ..) but not your project files in `app/`!
2020

2121
```bash
2222
docker-compose stop

0 commit comments

Comments
 (0)