Skip to content

Commit

Permalink
Merge branch 'release/5.2.0-beta3'
Browse files Browse the repository at this point in the history
  • Loading branch information
mblaschke committed Jan 18, 2017
2 parents 9342957 + 94f1f2d commit 4f8360f
Show file tree
Hide file tree
Showing 8 changed files with 216 additions and 15 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
@@ -1,7 +1,12 @@
PHP Docker Boilerplate Changelog
==================================

5.2.0-beta1 - 2016-12-06
5.2.0-beta3 - 2017-01-18
------------------------
- Reverted changes in docker-compose.development.yml (ports)
- Introducted docker-compose.development-reverse-proxy.yml for reverse proxy usage

5.2.0-beta2 - 2016-12-06
------------------------
- Remove port exposures
- DEV: Redirect all mails to mailcatcher (see environment var POSTFIX_RELAYHOST)
Expand Down
2 changes: 1 addition & 1 deletion README.md
@@ -1,6 +1,6 @@
![PHP Docker Boilerplate](https://static.webdevops.io/php-docker-boilerplate.svg)

[![latest v5.2.0-beta2](https://img.shields.io/badge/latest-v5.2.0-beta2-green.svg?style=flat)](https://github.com/webdevops/php-docker-boilerplate/releases/tag/5.2.0-beta2)
[![latest v5.2.0-beta3](https://img.shields.io/badge/latest-v5.2.0_beta3-green.svg?style=flat)](https://github.com/webdevops/php-docker-boilerplate/releases/tag/5.2.0-beta3)
![License MIT](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)

This is an easy customizable docker boilerplate for any PHP-based projects like _Symfony Framework_, _CakePHP_, _Yii_ and many other frameworks or applications.
Expand Down
3 changes: 2 additions & 1 deletion bin/backup.sh 100755 → 100644
Expand Up @@ -26,7 +26,8 @@ case "$1" in
fi

logMsg "Starting MySQL backup..."
dockerExec mysqldump --opt --single-transaction --events --all-databases --routines --comments | bzip2 > "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}"
source "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/../etc/environment.yml"
dockerExec mysqldump -h mysql -u root -p"${MYSQL_ROOT_PASSWORD}" --opt --single-transaction --events --all-databases --routines --comments | bzip2 > "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}"
logMsg "Finished"
else
echo " * Skipping mysql backup, no such container"
Expand Down
5 changes: 3 additions & 2 deletions bin/restore.sh
Expand Up @@ -22,8 +22,9 @@ case "$1" in
if [[ -n "$(dockerContainerId mysql)" ]]; then
if [ -f "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" ]; then
logMsg "Starting MySQL restore..."
bzcat "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" | dockerExec mysql
echo "FLUSH PRIVILEGES;" | dockerExec mysql
source "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/../etc/environment.yml"
bzcat "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" | dockerExec mysql -h mysql -u root -p"${MYSQL_ROOT_PASSWORD}"
echo "FLUSH PRIVILEGES;" | dockerExec mysql -h mysql -u root -p"${MYSQL_ROOT_PASSWORD}"
logMsg "Finished"
else
errorMsg "MySQL backup file not found"
Expand Down
199 changes: 199 additions & 0 deletions docker-compose.development-reverse-proxy.yml
@@ -0,0 +1,199 @@
version: '2'
services:
#######################################
# PHP application Docker container
#######################################
app:
build:
context: .
dockerfile: Dockerfile.development
links:
- mail
- mysql
#- postgres
#- solr
#- elasticsearch
#- redis
#- memcached
#- ftp
#ports:
# - "8000:80"
# - "8443:443"
# - "10022:22"
volumes:
- ./app/:/app/
- ./:/docker/
volumes_from:
- storage
# cap and privileged needed for slowlog
cap_add:
- SYS_PTRACE
privileged: true
env_file:
- etc/environment.yml
- etc/environment.development.yml
environment:
- VIRTUAL_HOST=.app.boilerplate.docker
- VIRTUAL_PORT=80
- POSTFIX_RELAYHOST=[mail]:1025


#######################################
# MySQL server
#######################################
mysql:
build:
context: docker/mysql/
#dockerfile: MySQL-5.5.Dockerfile
dockerfile: MySQL-5.6.Dockerfile
#dockerfile: MySQL-5.7.Dockerfile
#dockerfile: MariaDB-5.5.Dockerfile
#dockerfile: MariaDB-10.Dockerfile
#dockerfile: Percona-5.5.Dockerfile
#dockerfile: Percona-5.6.Dockerfile
#dockerfile: Percona-5.7.Dockerfile
#ports:
# - 13306:3306
volumes_from:
- storage
env_file:
- etc/environment.yml
- etc/environment.development.yml

#######################################
# PostgreSQL server
#######################################
#postgres:
# build:
# context: docker/postgres/
# dockerfile: Postgres-9.4.Dockerfile
# dockerfile: Postgres-9.5.Dockerfile
# ports:
# - 15432:5432
# volumes_from:
# - storage
# env_file:
# - etc/environment.yml
# - etc/environment.development.yml

#######################################
# Solr server
#######################################
#solr:
# build:
# context: docker/solr/
# volumes_from:
# - storage
# env_file:
# - etc/environment.yml
# - etc/environment.development.yml
# environment:
# - SOLR_STORAGE=/storage/solr/server-master/
# - VIRTUAL_HOST=solr.boilerplate.docker
# - VIRTUAL_PORT=8983

#######################################
# Elasticsearch
#######################################
#elasticsearch:
# build:
# context: docker/elasticsearch/
# ports:
# - 19200:9200
# - 19300:9300
# volumes_from:
# - storage
# env_file:
# - etc/environment.yml
# - etc/environment.development.yml
# environment:
# - VIRTUAL_HOST=elasticsearch.boilerplate.docker
# - VIRTUAL_PORT=9200

#######################################
# Redis
#######################################
#redis:
# build:
# context: docker/redis/
# volumes_from:
# - storage
# env_file:
# - etc/environment.yml
# - etc/environment.development.yml

#######################################
# Memcached
#######################################
#memcached:
# build:
# context: docker/memcached/
# volumes_from:
# - storage
# env_file:
# - etc/environment.yml
# - etc/environment.development.yml

#######################################
# Mail
#######################################
# Mailhog
mail:
image: mailhog/mailhog
# ports:
# - 8025:8025
environment:
- VIRTUAL_HOST=mail.boilerplate.docker
- VIRTUAL_PORT=8025

# Mailcatcher
#mail:
# image: schickling/mailcatcher
# environment:
# - VIRTUAL_HOST=mail.boilerplate.docker
# - VIRTUAL_PORT=1080


# Mailsandbox
#mail:
# image: webdevops/mail-sandbox
# environment:
# - VIRTUAL_HOST=mail.boilerplate.docker
# - VIRTUAL_PORT=80

#######################################
# FTP (vsftpd)
#######################################
#ftp:
# build:
# context: docker/vsftpd/
# volumes_from:
# - storage
# volumes:
# - ./:/application/
# env_file:
# - etc/environment.yml
# - etc/environment.development.yml

#######################################
# phpMyAdmin
#######################################
#phpmyadmin:
# image: phpmyadmin/phpmyadmin
# links:
# - mysql
# environment:
# - PMA_ARBITRARY=1
# - VIRTUAL_HOST=pma.boilerplate.docker
# - VIRTUAL_PORT=80
# volumes:
# - /sessions

#######################################
# Storage
#######################################
storage:
build:
context: docker/storage/
volumes:
- /storage
11 changes: 4 additions & 7 deletions docker-compose.development.yml
Expand Up @@ -16,13 +16,12 @@ services:
#- redis
#- memcached
#- ftp
#ports:
# - "8000:80"
# - "8443:443"
# - "10022:22"
ports:
- "8000:80"
- "8443:443"
- "10022:22"
volumes:
- ./app/:/app/
- /tmp/debug/:/tmp/debug/
- ./:/docker/
volumes_from:
- storage
Expand Down Expand Up @@ -57,8 +56,6 @@ services:
- 13306:3306
volumes_from:
- storage
volumes:
- /tmp/debug/:/tmp/debug/
env_file:
- etc/environment.yml
- etc/environment.development.yml
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.production.yml
Expand Up @@ -44,8 +44,6 @@ services:
#dockerfile: Percona-5.7.Dockerfile
volumes_from:
- storage
volumes:
- /tmp/debug/:/tmp/debug/
env_file:
- etc/environment.yml
- etc/environment.production.yml
Expand Down
2 changes: 1 addition & 1 deletion etc/environment.yml
Expand Up @@ -12,7 +12,7 @@
# General
WEB_DOCUMENT_ROOT=/app/
WEB_DOCUMENT_INDEX=index.php
CLI_SCRIPT=php /app/index.php
CLI_SCRIPT="php /app/index.php"

#######################################
# SSH settings
Expand Down

0 comments on commit 4f8360f

Please sign in to comment.