2016-10-09 16:47:49 +00:00
|
|
|
##
|
|
|
|
## -------------------------
|
|
|
|
## | D E V I L S T A C K |
|
|
|
|
## -------------------------
|
|
|
|
##
|
|
|
|
## Local LAMP/LEMP stack
|
|
|
|
##
|
|
|
|
##
|
|
|
|
##
|
|
|
|
##
|
|
|
|
##
|
|
|
|
## -- DO NOT EDIT THIS FILE --
|
|
|
|
##
|
|
|
|
## Edit '.env' for configuration.
|
|
|
|
##
|
|
|
|
## If '.env' does not exist, copy 'env-example' to '.env'
|
|
|
|
## $ cp env-example .env
|
|
|
|
##
|
|
|
|
|
|
|
|
|
2017-04-20 16:07:04 +00:00
|
|
|
version: '2'
|
2016-10-09 16:47:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# SERVICES
|
|
|
|
################################################################################
|
|
|
|
services:
|
|
|
|
|
2017-04-19 17:48:44 +00:00
|
|
|
# ----------------------------------------
|
2017-04-29 14:36:22 +00:00
|
|
|
# PHP-FPM
|
2017-04-19 17:48:44 +00:00
|
|
|
# ----------------------------------------
|
2017-04-29 14:36:22 +00:00
|
|
|
php:
|
2017-04-20 14:42:21 +00:00
|
|
|
# TODO: remove latest, once it is ready for the next release
|
2017-04-29 14:36:22 +00:00
|
|
|
image: cytopia/${PHP_SERVER}:latest
|
2017-04-19 17:48:44 +00:00
|
|
|
|
|
|
|
# Manually build via `docker-compose build`
|
|
|
|
#build:
|
2017-04-29 14:36:22 +00:00
|
|
|
#context: https://github.com/cytopia/docker-${PHP_SERVER}.git#1
|
|
|
|
# context: https://github.com/cytopia/docker-${PHP_SERVER}.git
|
2017-04-19 17:48:44 +00:00
|
|
|
|
|
|
|
environment:
|
|
|
|
|
2017-04-29 14:36:22 +00:00
|
|
|
##
|
|
|
|
## Debug?
|
|
|
|
##
|
|
|
|
- DEBUG_COMPOSE_ENTRYPOINT
|
2017-04-19 17:48:44 +00:00
|
|
|
|
2017-04-29 14:36:22 +00:00
|
|
|
##
|
|
|
|
## UserID and GroupID
|
|
|
|
##
|
|
|
|
- NEW_UID
|
|
|
|
- NEW_GID
|
2017-04-19 17:48:44 +00:00
|
|
|
|
2017-04-29 14:36:22 +00:00
|
|
|
##
|
|
|
|
## Adjust timezone
|
|
|
|
##
|
|
|
|
- TIMEZONE
|
2017-04-19 17:48:44 +00:00
|
|
|
|
2017-04-29 14:36:22 +00:00
|
|
|
##
|
|
|
|
## PHP Xdebug
|
|
|
|
##
|
|
|
|
- PHP_XDEBUG_ENABLE
|
|
|
|
- PHP_XDEBUG_REMOTE_PORT
|
|
|
|
- PHP_XDEBUG_REMOTE_HOST
|
2017-04-19 17:48:44 +00:00
|
|
|
|
2017-04-29 14:36:22 +00:00
|
|
|
##
|
|
|
|
## Mail-catching
|
|
|
|
##
|
|
|
|
- ENABLE_MAIL=1
|
|
|
|
|
|
|
|
##
|
|
|
|
## Enable 127.0.0.1 Port-forwarding
|
|
|
|
##
|
|
|
|
- FORWARD_PORTS_TO_LOCALHOST=3306:mysql:3306,5432:pgsql:5432,6379:redis:6379
|
|
|
|
|
|
|
|
##
|
|
|
|
## Additional variables to announce to intranet/php-container
|
|
|
|
##
|
|
|
|
# Ports
|
|
|
|
- HOST_PORT_HTTPD
|
|
|
|
# Paths
|
|
|
|
- HOST_PATH_HTTPD_DATADIR
|
|
|
|
- HOST_PATH_MYSQL_DATADIR
|
|
|
|
- HOST_PATH_PGSQL_DATADIR
|
|
|
|
# Database credentials
|
|
|
|
- PGSQL_ROOT_USER
|
|
|
|
- PGSQL_ROOT_PASSWORD
|
|
|
|
- MYSQL_ROOT_PASSWORD
|
|
|
|
# Selected Server versions
|
|
|
|
- PHP_SERVER
|
|
|
|
- HTTPD_SERVER
|
|
|
|
- PGSQL_SERVER
|
|
|
|
- MYSQL_SERVER
|
|
|
|
- REDIS_SERVER
|
2017-04-19 17:48:44 +00:00
|
|
|
|
|
|
|
networks:
|
|
|
|
app_net:
|
2017-04-29 14:36:22 +00:00
|
|
|
ipv4_address: 172.16.238.11
|
2017-04-19 17:48:44 +00:00
|
|
|
|
|
|
|
volumes:
|
|
|
|
# ---- Format: ----
|
|
|
|
# HOST-DIRECTORY : DOCKER-DIRECTORY
|
|
|
|
|
|
|
|
# Mount custom intranet
|
|
|
|
# (configured in /etc/${HTTPD_SERVER}/01-vhost-default.conf)
|
|
|
|
- ${DEVILBOX_PATH}/.devilbox/www:/var/www/default:ro
|
|
|
|
|
2017-04-29 14:36:22 +00:00
|
|
|
# Mount logs
|
|
|
|
- ${DEVILBOX_PATH}/log/${PHP_SERVER}:/var/log/php
|
|
|
|
|
|
|
|
# Mount MySQL Socket directory
|
|
|
|
- mysql_socket_volume:/tmp/mysql
|
|
|
|
|
|
|
|
# Mount Mail directory
|
|
|
|
#- ${DEVILBOX_PATH}/run/mail:/var/mail
|
|
|
|
|
|
|
|
# Mount devilbox user-defined *.ini files in order
|
|
|
|
# to overwrite the default PHP configuration
|
|
|
|
- ${DEVILBOX_PATH}/cfg/${PHP_SERVER}:/etc/php-custom.d:ro
|
2017-04-19 17:48:44 +00:00
|
|
|
|
|
|
|
# Mount custom mass virtual hosting
|
|
|
|
# (configured in /etc/${HTTPD_SERVER}/02-vhost-mass.conf)
|
2017-04-29 14:36:22 +00:00
|
|
|
- ${HOST_PATH_HTTPD_DATADIR}:/shared/httpd
|
2017-04-20 14:42:21 +00:00
|
|
|
|
2017-04-19 17:48:44 +00:00
|
|
|
|
|
|
|
# ----------------------------------------
|
2017-04-29 14:36:22 +00:00
|
|
|
# HTTPD
|
2017-04-19 17:48:44 +00:00
|
|
|
# ----------------------------------------
|
2017-04-29 14:36:22 +00:00
|
|
|
httpd:
|
2017-04-19 17:48:44 +00:00
|
|
|
# TODO: remove latest, once it is ready for the next release
|
2017-04-29 14:36:22 +00:00
|
|
|
image: cytopia/${HTTPD_SERVER}:latest
|
2017-04-19 17:48:44 +00:00
|
|
|
|
|
|
|
# Manually build via `docker-compose build`
|
|
|
|
#build:
|
2017-04-29 14:36:22 +00:00
|
|
|
#context: https://github.com/cytopia/docker-${HTTPD_SERVER}.git#1
|
|
|
|
# context: https://github.com/cytopia/docker-${HTTPD_SERVER}.git
|
2017-04-19 17:48:44 +00:00
|
|
|
|
|
|
|
environment:
|
|
|
|
|
|
|
|
##
|
2017-04-29 14:36:22 +00:00
|
|
|
## Debug?
|
2017-04-19 17:48:44 +00:00
|
|
|
##
|
2017-04-29 14:36:22 +00:00
|
|
|
- DEBUG_COMPOSE_ENTRYPOINT
|
2016-10-09 16:47:49 +00:00
|
|
|
|
2017-04-19 17:48:44 +00:00
|
|
|
##
|
2017-04-29 14:36:22 +00:00
|
|
|
## Adjust timezone
|
2017-04-19 17:48:44 +00:00
|
|
|
##
|
2017-04-29 14:36:22 +00:00
|
|
|
- TIMEZONE
|
2017-04-19 17:48:44 +00:00
|
|
|
|
|
|
|
##
|
2017-04-29 14:36:22 +00:00
|
|
|
## PHP-FPM Remote Server
|
2017-04-19 17:48:44 +00:00
|
|
|
##
|
2017-04-29 14:36:22 +00:00
|
|
|
- PHP_FPM_ENABLE=1
|
|
|
|
- PHP_FPM_SERVER_ADDR=php
|
|
|
|
- PHP_FPM_SERVER_PORT=9000
|
2017-04-19 17:48:44 +00:00
|
|
|
|
2017-04-29 14:36:22 +00:00
|
|
|
## Tell the webserver to look into this directory
|
|
|
|
## for additional configuration files.
|
2017-04-19 17:48:44 +00:00
|
|
|
##
|
2017-04-29 14:36:22 +00:00
|
|
|
## @see volumes:: - ./etc/${HTTPD_SERVER}:/etc/${HTTPD_SERVER}
|
|
|
|
- CUSTOM_HTTPD_CONF_DIR=/etc/${HTTPD_SERVER}
|
2016-10-09 16:47:49 +00:00
|
|
|
|
2017-04-29 14:36:22 +00:00
|
|
|
ports:
|
|
|
|
# ---- Format: ----
|
|
|
|
# [HOST-ADDR : ] HOST-PORT : DOCKER-PORT
|
|
|
|
- "${LOCAL_LISTEN_ADDR}${HOST_PORT_HTTPD}:80"
|
2016-10-09 16:47:49 +00:00
|
|
|
|
2017-04-19 17:48:44 +00:00
|
|
|
networks:
|
|
|
|
app_net:
|
2017-04-29 14:36:22 +00:00
|
|
|
ipv4_address: 172.16.238.10
|
2016-10-09 16:47:49 +00:00
|
|
|
|
2017-04-19 17:48:44 +00:00
|
|
|
volumes:
|
|
|
|
# ---- Format: ----
|
|
|
|
# HOST-DIRECTORY : DOCKER-DIRECTORY
|
2016-11-15 18:52:39 +00:00
|
|
|
|
2017-04-29 14:36:22 +00:00
|
|
|
# Custom scripts/binaries required for httpd server vhost
|
|
|
|
# configuration to work.
|
|
|
|
# (configured in /etc/${HTTPD_SERVER}/02-vhost-mass.conf)
|
|
|
|
- ${DEVILBOX_PATH}/.devilbox/bin/${HTTPD_SERVER}:/opt/bin:ro
|
|
|
|
|
|
|
|
# Mount user-defined httpd configuration files
|
|
|
|
# @see environment::CUSTOM_HTTPD_CONF_DIR for how this
|
|
|
|
# is added in httpd server
|
|
|
|
- ${DEVILBOX_PATH}/.devilbox/etc/${HTTPD_SERVER}:/etc/${HTTPD_SERVER}:ro
|
|
|
|
|
2017-04-19 17:48:44 +00:00
|
|
|
# Mount custom intranet
|
|
|
|
# (configured in /etc/${HTTPD_SERVER}/01-vhost-default.conf)
|
|
|
|
- ${DEVILBOX_PATH}/.devilbox/www:/var/www/default:ro
|
2016-11-15 18:52:39 +00:00
|
|
|
|
2017-04-29 14:36:22 +00:00
|
|
|
# Mount user-defined httpd log
|
|
|
|
# @see ./etc/${HTTPD_SERVER}/*.conf for log defines
|
|
|
|
- ${DEVILBOX_PATH}/log/${HTTPD_SERVER}:/var/log/${HTTPD_SERVER}
|
2016-10-09 16:47:49 +00:00
|
|
|
|
2017-04-19 17:48:44 +00:00
|
|
|
# Mount custom mass virtual hosting
|
|
|
|
# (configured in /etc/${HTTPD_SERVER}/02-vhost-mass.conf)
|
2017-04-29 14:36:22 +00:00
|
|
|
- ${HOST_PATH_HTTPD_DATADIR}:/shared/httpd:ro
|
2016-10-09 16:47:49 +00:00
|
|
|
|
2017-04-20 14:42:21 +00:00
|
|
|
depends_on:
|
2017-04-29 14:36:22 +00:00
|
|
|
- php
|
2017-04-20 14:42:21 +00:00
|
|
|
|
2016-10-30 13:40:29 +00:00
|
|
|
|
2017-04-19 17:48:44 +00:00
|
|
|
# ----------------------------------------
|
|
|
|
# DATABASE
|
|
|
|
# ----------------------------------------
|
|
|
|
mysql:
|
2017-04-20 14:42:21 +00:00
|
|
|
# TODO: remove latest, once it is ready for the next release
|
2017-04-19 17:48:44 +00:00
|
|
|
image: cytopia/${MYSQL_SERVER}:latest
|
2016-10-09 16:47:49 +00:00
|
|
|
|
2017-04-19 17:48:44 +00:00
|
|
|
# Manually build via `docker-compose build`
|
|
|
|
#build:
|
|
|
|
#context: https://github.com/cytopia/docker-${MYSQL_SERVER}.git#1
|
|
|
|
# context: https://github.com/cytopia/docker-${MYSQL_SERVER}.git
|
2016-10-09 16:47:49 +00:00
|
|
|
|
2017-04-19 17:48:44 +00:00
|
|
|
environment:
|
2016-10-24 23:57:53 +00:00
|
|
|
|
2017-04-29 14:36:22 +00:00
|
|
|
##
|
|
|
|
## Debug?
|
|
|
|
##
|
|
|
|
- DEBUG_COMPOSE_ENTRYPOINT
|
2016-10-24 23:57:53 +00:00
|
|
|
|
2017-04-29 14:36:22 +00:00
|
|
|
##
|
|
|
|
## Adjust timezone
|
|
|
|
##
|
|
|
|
- TIMEZONE
|
2016-10-09 16:47:49 +00:00
|
|
|
|
2017-04-29 14:36:22 +00:00
|
|
|
##
|
|
|
|
## Adjust Root password
|
|
|
|
##
|
|
|
|
- MYSQL_ROOT_PASSWORD
|
2016-10-09 16:47:49 +00:00
|
|
|
|
2017-04-29 14:36:22 +00:00
|
|
|
##
|
|
|
|
## Socket directory Path
|
|
|
|
##
|
2017-04-19 17:48:44 +00:00
|
|
|
- MYSQL_SOCKET_DIR=/tmp/mysql
|
2016-10-09 16:47:49 +00:00
|
|
|
|
2017-04-29 14:36:22 +00:00
|
|
|
##
|
|
|
|
## Runtime settings
|
|
|
|
##
|
2017-04-19 17:48:44 +00:00
|
|
|
- MYSQL_GENERAL_LOG=${MYSQL_GENERAL_LOG}
|
2016-10-09 16:47:49 +00:00
|
|
|
|
2017-04-19 17:48:44 +00:00
|
|
|
ports:
|
|
|
|
# [local-machine:]local-port:docker-port
|
|
|
|
- "${LOCAL_LISTEN_ADDR}${HOST_PORT_MYSQL}:3306"
|
2016-10-09 16:47:49 +00:00
|
|
|
|
2017-04-19 17:48:44 +00:00
|
|
|
networks:
|
|
|
|
app_net:
|
|
|
|
ipv4_address: 172.16.238.12
|
2016-10-09 16:47:49 +00:00
|
|
|
|
2017-04-19 17:48:44 +00:00
|
|
|
volumes:
|
|
|
|
# ---- Format: ----
|
|
|
|
# HOST-DIRECTORY : DOCKER-DIRECTORY
|
2016-10-09 16:47:49 +00:00
|
|
|
|
2017-04-19 17:48:44 +00:00
|
|
|
# Mount logs
|
|
|
|
- ${DEVILBOX_PATH}/log/${MYSQL_SERVER}:/var/log/mysql
|
2016-10-09 16:47:49 +00:00
|
|
|
|
2017-04-19 17:48:44 +00:00
|
|
|
# Mount MySQL Socket directory
|
2017-04-20 15:47:27 +00:00
|
|
|
- mysql_socket_volume:/tmp/mysql
|
2016-10-11 13:45:21 +00:00
|
|
|
|
2017-04-21 21:17:59 +00:00
|
|
|
# Mount devilbox default overwrites
|
|
|
|
- ${DEVILBOX_PATH}/.devilbox/etc/${MYSQL_SERVER}:/etc/mysql/docker-default.d:ro
|
|
|
|
|
2017-04-19 17:48:44 +00:00
|
|
|
# Mount devilbox user-defined cnf files in order
|
|
|
|
# to overwrite the MySQL server configuration
|
|
|
|
- ${DEVILBOX_PATH}/cfg/${MYSQL_SERVER}:/etc/mysql/conf.d:ro
|
2016-10-09 16:47:49 +00:00
|
|
|
|
2017-04-19 17:48:44 +00:00
|
|
|
# Mount MySQL Data directory
|
2017-04-29 14:36:22 +00:00
|
|
|
- ${HOST_PATH_MYSQL_DATADIR}/${MYSQL_SERVER}:/var/lib/mysql
|
|
|
|
depends_on:
|
|
|
|
- php
|
|
|
|
- httpd
|
2016-10-09 16:47:49 +00:00
|
|
|
|
|
|
|
|
2017-04-19 17:48:44 +00:00
|
|
|
# ----------------------------------------
|
2017-04-29 14:36:22 +00:00
|
|
|
# POSTGRESQL
|
2017-04-19 17:48:44 +00:00
|
|
|
# ----------------------------------------
|
2017-04-29 14:36:22 +00:00
|
|
|
pgsql:
|
|
|
|
image: postgres:${PGSQL_SERVER}
|
2016-10-09 16:47:49 +00:00
|
|
|
|
2017-04-19 17:48:44 +00:00
|
|
|
# Manually build via `docker-compose build`
|
|
|
|
#build:
|
|
|
|
#context: https://github.com/cytopia/docker-${MYSQL_SERVER}.git#1
|
|
|
|
# context: https://github.com/cytopia/docker-${MYSQL_SERVER}.git
|
2016-10-09 16:47:49 +00:00
|
|
|
|
2017-04-19 17:48:44 +00:00
|
|
|
environment:
|
2016-10-16 08:49:53 +00:00
|
|
|
|
2017-04-29 14:36:22 +00:00
|
|
|
- POSTGRES_USER=${PGSQL_ROOT_USER}
|
|
|
|
- POSTGRES_PASSWORD=${PGSQL_ROOT_PASSWORD}
|
2017-04-19 17:48:44 +00:00
|
|
|
- PGDATA=/var/lib/postgresql/data/pgdata
|
2016-10-09 16:47:49 +00:00
|
|
|
|
2017-04-19 17:48:44 +00:00
|
|
|
ports:
|
|
|
|
# [local-machine:]local-port:docker-port
|
2017-04-29 14:36:22 +00:00
|
|
|
- "${LOCAL_LISTEN_ADDR}${HOST_PORT_PGSQL}:5432"
|
2016-10-09 16:47:49 +00:00
|
|
|
|
2017-04-19 17:48:44 +00:00
|
|
|
networks:
|
|
|
|
app_net:
|
|
|
|
ipv4_address: 172.16.238.13
|
2016-11-15 18:52:39 +00:00
|
|
|
|
2017-04-19 17:48:44 +00:00
|
|
|
volumes:
|
|
|
|
# ---- Format: ----
|
|
|
|
# HOST-DIRECTORY : DOCKER-DIRECTORY
|
2016-11-15 18:52:39 +00:00
|
|
|
|
2017-04-19 17:48:44 +00:00
|
|
|
# Mount logs
|
2017-04-29 14:36:22 +00:00
|
|
|
- ${DEVILBOX_PATH}/log/postgres-${PGSQL_SERVER}:/var/log/postgresql
|
2016-11-15 18:52:39 +00:00
|
|
|
|
2017-04-19 17:48:44 +00:00
|
|
|
# Mount PostgreSQL Socket directory
|
2017-04-20 15:47:27 +00:00
|
|
|
- pgsql_socket_volume:/var/run/postgresql
|
2016-11-15 18:52:39 +00:00
|
|
|
|
2017-04-19 17:48:44 +00:00
|
|
|
# Mount PostgreSQL Data directory
|
2017-04-29 14:36:22 +00:00
|
|
|
- ${HOST_PATH_PGSQL_DATADIR}/${PGSQL_SERVER}:/var/lib/postgresql/data/pgdata
|
|
|
|
depends_on:
|
|
|
|
- php
|
|
|
|
- httpd
|
|
|
|
|
|
|
|
|
|
|
|
# ----------------------------------------
|
|
|
|
# Redis
|
|
|
|
# ----------------------------------------
|
|
|
|
redis:
|
|
|
|
image: redis:${REDIS_SERVER}
|
|
|
|
|
|
|
|
ports:
|
|
|
|
# [local-machine:]local-port:docker-port
|
|
|
|
- "${LOCAL_LISTEN_ADDR}${HOST_PORT_REDIS}:6379"
|
|
|
|
|
|
|
|
networks:
|
|
|
|
app_net:
|
|
|
|
ipv4_address: 172.16.238.14
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
# ---- Format: ----
|
|
|
|
# HOST-DIRECTORY : DOCKER-DIRECTORY
|
|
|
|
|
|
|
|
# Mount logs
|
|
|
|
- ${DEVILBOX_PATH}/log/redis-${REDIS_SERVER}:/var/log/redis
|
|
|
|
depends_on:
|
|
|
|
- php
|
|
|
|
- httpd
|
2016-11-15 18:52:39 +00:00
|
|
|
|
2016-10-09 16:47:49 +00:00
|
|
|
|
2017-04-20 15:47:27 +00:00
|
|
|
################################################################################
|
|
|
|
# VOLUMES
|
|
|
|
################################################################################
|
|
|
|
volumes:
|
|
|
|
# Create volume for mysql socket.
|
|
|
|
# This removes the need to mount the socket to the host
|
|
|
|
# but be able to mount it to different containers (from another container)
|
|
|
|
mysql_socket_volume:
|
|
|
|
|
|
|
|
# Create volume for postgresql socket.
|
|
|
|
# This removes the need to mount the socket to the host
|
|
|
|
# but be able to mount it to different containers (from another container)
|
|
|
|
pgsql_socket_volume:
|
|
|
|
|
|
|
|
|
2016-10-09 16:47:49 +00:00
|
|
|
################################################################################
|
|
|
|
# NETWORK
|
|
|
|
################################################################################
|
|
|
|
networks:
|
|
|
|
app_net:
|
|
|
|
driver: bridge
|
|
|
|
driver_opts:
|
|
|
|
com.docker.network.enable_ipv6: "false"
|
|
|
|
ipam:
|
|
|
|
driver: default
|
|
|
|
config:
|
2017-04-19 17:48:44 +00:00
|
|
|
- subnet: 172.16.238.0/24
|
|
|
|
gateway: 172.16.238.1
|