Skip to content

Commit 4c62ecd

Browse files
committed
Merge branch 'release/3.5.0'
2 parents a87e7c6 + eeaeaa0 commit 4c62ecd

19 files changed

+278
-16
lines changed

Diff for: CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
TYPO3 Docker Boilerplate Changelog
22
==================================
33

4+
3.5.0 - 2015-06-23
5+
-----------------------
6+
- Added `ftp` container (with vsftpd)
7+
- Added `postgres` container (with PostgreSQL)
8+
- Enabled php module `mcrypt` by default
9+
- Improved documentation
10+
411
3.4.0 - 2015-06-15
512
-------------------------------------
613
- Renamed `PHP_UID` and `PHP_GID` to `EFFECTIVE_UID` and `EFFECTIVE_GID`

Diff for: README.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
# Dockerized PHP web project boilerplate
22

3-
![latest v3.4.0](https://img.shields.io/badge/latest-v3.4.0-green.svg?style=flat)
3+
![latest v3.5.0](https://img.shields.io/badge/latest-v3.5.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-
This is an easy customizable docker boilerplate for any PHP based projects like _TYPO3 CMS_, _TYPO3 NEOS_, _TYPO3 FLOW_, _Symfony Framework_ and many other.
8+
This is an easy customizable docker boilerplate for any PHP based projects like _TYPO3 CMS_, _Symfony Framework_, _FLOW/NEOS_ and many other frameworks or applications.
99

1010
Supports:
1111

1212
- Nginx or Apache HTTPd
1313
- PHP-FPM (with Xdebug)
1414
- MySQL, MariaDB or PerconaDB
15+
- PostgreSQL
1516
- Solr (disabled, with TYPO3 CMS EXT:solr configuration as example)
1617
- Elasticsearch (disabled, without configuration)
1718
- Redis (disabled)
1819
- Memcached (disabled)
1920
- Mailcatcher (if no mail sandbox is used, eg. [Vagrant Development VM](https://github.com/mblaschke/vagrant-development))
21+
- FTP server (vsftpd)
2022
- Support for `TYPO3_CONTEXT` and `FLOW_CONTEXT` for TYPO3, FLOW, NEOS.
2123
- maybe more later...
2224

@@ -34,6 +36,7 @@ Use can use my [Vagrant Development VM](https://github.com/mblaschke/vagrant-dev
3436

3537
- [Installation and requirements](/documentation/INSTALL.md)
3638
- [Updating docker boilerplate](/documentation/UPDATE.md)
39+
- [Customizing](/documentation/CUSTOMIZE.md)
3740
- [Docker Quickstart](/documentation/DOCKER-QUICKSTART.md)
3841
- [Run your project](/documentation/DOCKER-STARTUP.md)
3942
- [Container detail info](/documentation/DOCKER-INFO.md)

Diff for: docker-compose.yml

+27
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ main:
55
build: docker/main/
66
links:
77
- mysql
8+
#- postgres
89
#- mail
910
#- solr
1011
#- elasticsearch
1112
#- redis
1213
#- memcached
14+
#- ftp
1315
volumes:
1416
- ./:/docker/
1517
- /tmp/debug/:/tmp/debug/
@@ -53,6 +55,18 @@ mysql:
5355
env_file:
5456
- docker-env.yml
5557

58+
#######################################
59+
# PostgreSQL server
60+
#######################################
61+
#postgres:
62+
# build: docker/postgres/
63+
# ports:
64+
# - 15432:5432
65+
# volumes_from:
66+
# - storage
67+
# env_file:
68+
# - docker-env.yml
69+
5670
#######################################
5771
# Solr server
5872
#######################################
@@ -110,6 +124,19 @@ mysql:
110124
# env_file:
111125
# - docker-env.yml
112126

127+
#######################################
128+
# FTP (vsftpd)
129+
#######################################
130+
#ftp:
131+
# build: docker/vsftpd/
132+
# volumes_from:
133+
# - storage
134+
# volumes:
135+
# - ./:/docker/
136+
# - /tmp/debug/:/tmp/debug/
137+
# env_file:
138+
# - docker-env.yml
139+
113140
#######################################
114141
# Storage
115142
#######################################

Diff for: docker-env.yml

+49-11
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,84 @@
1-
# Settings: TYPO3 CMS
1+
#######################################
2+
# Environment Configuration
3+
# - feel free to edit -
4+
# -> for most changes you only have to
5+
# docker-compose up -d
6+
# to apply them
7+
#######################################
8+
9+
#######################################
10+
# Webserver
11+
12+
# TYPO3 CMS
213
DOCUMENT_ROOT=code/
314
DOCUMENT_INDEX=index.php
415
CLI_SCRIPT=php typo3/cli_dispatch.phpsh
516

6-
# Settings: NEOS or FLOW
7-
#DOCUMENT_ROOT=code/Web/
8-
#DOCUMENT_INDEX=index.php
9-
#CLI_SCRIPT=php flow
10-
11-
# Settings: SYMFONY FRAMEWORK
17+
# SYMFONY FRAMEWORK
1218
#DOCUMENT_ROOT=code/web/
1319
#DOCUMENT_INDEX=app_dev.php
1420
#CLI_SCRIPT=php app/console
1521

16-
# Contexts environment
22+
# NEOS or FLOW
23+
#DOCUMENT_ROOT=code/Web/
24+
#DOCUMENT_INDEX=index.php
25+
#CLI_SCRIPT=php flow
26+
27+
#######################################
28+
# Context environment
1729
TYPO3_CONTEXT=Development/Docker
1830
FLOW_CONTEXT=Development/Docker
1931
FLOW_REWRITEURLS=1
2032
SYMFONY_ENV=dev
2133
SYMFONY_DEBUG=0
2234

23-
# Mail - Vagrant mail sandbox
35+
#######################################
36+
# Mail
37+
38+
# Vagrant mail sandbox
2439
MAIL_GATEWAY=192.168.56.2
2540

26-
# Mail - Mailcatcher
41+
# Mailcatcher (container)
2742
#MAIL_GATEWAY=mail:1025
2843

29-
# Service settings
44+
#######################################
45+
# Internal dns routing
3046
DNS_DOMAIN=vm vm.dev
3147

48+
#######################################
3249
# MySQL settings
50+
# -> if you change these settings
51+
# you have to remove the database:
52+
# docker-compose rm mysql
53+
# because it's stored database in
54+
# volume and provisioning is only
55+
# done once.
3356
MYSQL_ROOT_PASSWORD=dev
3457
MYSQL_USER=dev
3558
MYSQL_PASSWORD=dev
3659
MYSQL_DATABASE=typo3
3760

61+
#######################################
62+
# PostgreSQL settings
63+
POSTGRES_USER=dev
64+
POSTGRES_PASSWORD=dev
65+
66+
#######################################
67+
# FTP settings
68+
FTP_USER=dev
69+
FTP_PASSWORD=dev
70+
FTP_PATH=/data/ftp/
71+
#FTP_PATH=/docker/code/
72+
73+
#######################################
3874
# PHP Settings
3975
PHP_TIMEZONE=UTC
4076

77+
#######################################
4178
# Permission settings
4279
EFFECTIVE_UID=1000
4380
EFFECTIVE_GID=1000
4481

82+
#######################################
4583
# Default cli user (should be www-data)
4684
CLI_USER=www-data

Diff for: docker/elasticsearch/Dockerfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
FROM dockerfile/elasticsearch
2-
1+
FROM elasticsearch

Diff for: docker/httpd/conf/vhost.conf

+3
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ SetEnv MYSQL_ROOT_USER "root"
3535
SetEnv MYSQL_ROOT_PASSWORD "<MYSQL_ROOT_PASSWORD>"
3636
SetEnv MYSQL_DATABASE "<MYSQL_DATABASE>"
3737

38+
SetEnv POSTGRES_USER "<POSTGRES_USER>"
39+
SetEnv POSTGRES_PASSWORD "<POSTGRES_PASSWORD>"
40+
3841
DirectoryIndex <DOCUMENT_INDEX> index.html index.htm
3942

4043
DocumentRoot "<DOCUMENT_ROOT>"

Diff for: docker/httpd/entrypoint.sh

+3
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ cp /usr/local/apache2/conf/.docker-vhost.conf.original /usr/local/apache
5454
/bin/sed -i "s@<MYSQL_ROOT_PASSWORD>@${MYSQL_ROOT_PASSWORD}@" /usr/local/apache2/conf/docker-vhost.conf
5555
/bin/sed -i "s@<MYSQL_DATABASE>@${MYSQL_DATABASE}@" /usr/local/apache2/conf/docker-vhost.conf
5656

57+
/bin/sed -i "s@<POSTGRES_USER>@${POSTGRES_USER}@" /usr/local/apache2/conf/docker-vhost.conf
58+
/bin/sed -i "s@<POSTGRES_PASSWORD>@${POSTGRES_PASSWORD}@" /usr/local/apache2/conf/docker-vhost.conf
59+
5760
#############################
5861
## COMMAND
5962
#############################

Diff for: docker/main/bin/install.sh

+3
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ locale-gen
7777
touch /etc/php5/mods-available/docker-boilerplate.ini
7878
php5enmod docker-boilerplate
7979

80+
# enable ext mcrypt
81+
php5enmod mcrypt
82+
8083
#############################
8184
# Composer
8285
#############################

Diff for: docker/nginx/conf/vhost.conf

+6
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ server {
3232
fastcgi_param MYSQL_ROOT_PASSWORD "<MYSQL_ROOT_PASSWORD>";
3333
fastcgi_param MYSQL_DATABASE "<MYSQL_DATABASE>";
3434

35+
fastcgi_param POSTGRES_USER "<POSTGRES_USER>";
36+
fastcgi_param POSTGRES_PASSWORD "<POSTGRES_PASSWORD>";
37+
3538
fastcgi_read_timeout 1000;
3639
}
3740
}
@@ -78,6 +81,9 @@ server {
7881
fastcgi_param MYSQL_ROOT_PASSWORD "<MYSQL_ROOT_PASSWORD>";
7982
fastcgi_param MYSQL_DATABASE "<MYSQL_DATABASE>";
8083

84+
fastcgi_param POSTGRES_USER "<POSTGRES_USER>";
85+
fastcgi_param POSTGRES_PASSWORD "<POSTGRES_PASSWORD>";
86+
8187
fastcgi_read_timeout 1000;
8288
}
8389
}

Diff for: docker/nginx/entrypoint.sh

+3
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ cp /opt/docker/vhost.conf /etc/nginx/conf.d/vhost.conf
3838
/bin/sed -i "s@<MYSQL_ROOT_PASSWORD>@${MYSQL_ROOT_PASSWORD}@" /etc/nginx/conf.d/vhost.conf
3939
/bin/sed -i "s@<MYSQL_DATABASE>@${MYSQL_DATABASE}@" /etc/nginx/conf.d/vhost.conf
4040

41+
/bin/sed -i "s@<POSTGRES_USER>@${POSTGRES_USER}@" /etc/nginx/conf.d/vhost.conf
42+
/bin/sed -i "s@<POSTGRES_PASSWORD>@${POSTGRES_PASSWORD}@" /etc/nginx/conf.d/vhost.conf
43+
4144
#############################
4245
## COMMAND
4346
#############################

Diff for: docker/postgres/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FROM postgres:9.4

Diff for: docker/storage/entrypoint.sh

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
mkdir -p /data/solr/
88
mkdir -p /data/dns/
9+
mkdir -p /data/ftp/
910
mkdir -p /data/cache/
1011

1112
find /data/ -type d -print0 | xargs -0 --no-run-if-empty chmod 777

Diff for: docker/vsftpd/Dockerfile

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
FROM ubuntu:14.04
2+
3+
ENV VSFTP_USER dev
4+
ENV VSFTP_PASSWORD dev
5+
ENV VSFTP_PATH /data/ftp/
6+
7+
RUN apt-get update && \
8+
apt-get install -y vsftpd supervisor net-tools
9+
10+
RUN mkdir -p /var/run/vsftpd/empty
11+
RUN mkdir -p /var/log/supervisor
12+
13+
COPY entrypoint.sh /entrypoint.sh
14+
COPY conf/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
15+
COPY conf/vsftpd.conf /etc/vsftpd.conf
16+
17+
RUN mkdir -p /data/ftp/
18+
19+
VOLUME "/data/ftp/"
20+
21+
EXPOSE 20
22+
EXPOSE 21
23+
EXPOSE 12020
24+
EXPOSE 12021
25+
EXPOSE 12022
26+
EXPOSE 12023
27+
EXPOSE 12024
28+
EXPOSE 12025
29+
30+
ENTRYPOINT ["/entrypoint.sh"]
31+
32+
CMD ["supervisord"]

Diff for: docker/vsftpd/conf/supervisord.conf

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[supervisord]
2+
nodaemon=true
3+
4+
[program:vsftpd]
5+
command=vsftpd

Diff for: docker/vsftpd/conf/vsftpd.conf

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
listen=YES
2+
anonymous_enable=NO
3+
local_enable=YES
4+
write_enable=YES
5+
anon_upload_enable=NO
6+
anon_mkdir_write_enable=NO
7+
dirmessage_enable=YES
8+
use_localtime=YES
9+
xferlog_enable=YES
10+
connect_from_port_20=YES
11+
secure_chroot_dir=/var/run/vsftpd/empty
12+
pam_service_name=vsftpd
13+
rsa_cert_file=/etc/ssl/private/vsftpd.pem
14+
max_per_ip=100
15+
max_clients=100
16+
17+
pasv_min_port=12020
18+
pasv_max_port=12025
19+
20+
file_open_mode=0666
21+
local_umask=000
22+
23+
allow_writeable_chroot=YES
24+
vsftpd_log_file=/var/log/vsftpd.log
25+
background=NO

Diff for: docker/vsftpd/entrypoint.sh

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash
2+
set -e
3+
4+
#############################
5+
## USER
6+
#############################
7+
8+
mkdir -p "${FTP_PATH}"
9+
10+
if ( id "${FTP_USER}" ); then
11+
echo "User ${FTP_USER} already exists"
12+
else
13+
echo "Creating user and group ${FTP_USER}"
14+
ENC_PASS=$(perl -e 'print crypt($ARGV[0], "password")' "${FTP_PASSWORD}")
15+
groupadd -g "${EFFECTIVE_GID}" "${FTP_USER}"
16+
useradd -d "${FTP_PATH}" -m -p "${ENC_PASS}" -u "${EFFECTIVE_UID}" --gid "${FTP_USER}" -s /bin/sh "${FTP_USER}"
17+
fi
18+
19+
#############################
20+
## COMMAND
21+
#############################
22+
23+
case "$1" in
24+
25+
## Supervisord (start daemons)
26+
supervisord)
27+
## Register IP
28+
ETH0_IP=$(/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')
29+
mkdir -p /data/dns/
30+
chmod 777 /data/dns/
31+
echo "${ETH0_IP}" > /data/dns/ftp.ip
32+
echo "${ETH0_IP} ftp ftp_1" > /data/dns/ftp.hosts
33+
34+
## Start services
35+
exec supervisord
36+
;;
37+
38+
## All other commands
39+
*)
40+
exec "$@"
41+
;;
42+
esac

0 commit comments

Comments
 (0)