mirror of
https://github.com/cytopia/devilbox.git
synced 2024-12-20 05:17:53 +00:00
268 lines
7.9 KiB
YAML
268 lines
7.9 KiB
YAML
##
|
|
## -------------------------
|
|
## | 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
|
|
##
|
|
|
|
|
|
version: '2'
|
|
|
|
|
|
################################################################################
|
|
# SERVICES
|
|
################################################################################
|
|
services:
|
|
|
|
# ----------------------------------------
|
|
# HTTP
|
|
# ----------------------------------------
|
|
httpd:
|
|
#image: cytopia/${HTTPD_SERVER}:1
|
|
image: cytopia/${HTTPD_SERVER}
|
|
|
|
# Manually build via `docker-compose build`
|
|
#build:
|
|
#context: https://github.com/cytopia/docker-${HTTPD_SERVER}.git#1
|
|
# context: https://github.com/cytopia/docker-${HTTPD_SERVER}.git
|
|
|
|
environment:
|
|
|
|
# Show all executed commands during docker entrypoint?
|
|
- DEBUG_COMPOSE_ENTRYPOINT=${DEBUG_COMPOSE_ENTRYPOINT}
|
|
|
|
# Adjust timezone
|
|
- TIMEZONE=${TIMEZONE}
|
|
|
|
# Enable PHP-FPM support
|
|
- PHP_FPM_ENABLE=1
|
|
- PHP_FPM_SERVER_ADDR=172.16.238.11
|
|
- PHP_FPM_SERVER_PORT=9000
|
|
|
|
# Tell the webserver to look into this directory
|
|
# for additional configuration files.
|
|
#
|
|
# @see volumes:: - ./etc/${HTTPD_SERVER}:/etc/${HTTPD_SERVER}
|
|
- CUSTOM_HTTPD_CONF_DIR=/etc/${HTTPD_SERVER}
|
|
|
|
ports:
|
|
# ---- Format: ----
|
|
# [HOST-ADDR : ] HOST-PORT : DOCKER-PORT
|
|
- "127.0.0.1:80:80"
|
|
|
|
networks:
|
|
app_net:
|
|
ipv4_address: 172.16.238.10
|
|
|
|
volumes:
|
|
# ---- Format: ----
|
|
# HOST-DIRECTORY : DOCKER-DIRECTORY
|
|
|
|
|
|
# Custom scripts/binaries required for httpd server vhost
|
|
# configuration to work.
|
|
# (configured in /etc/${HTTPD_SERVER}/02-vhost-mass.conf)
|
|
- ./bin/${HTTPD_SERVER}:/opt/bin
|
|
|
|
# Mount user-defined httpd configuration files
|
|
# @see environment::CUSTOM_HTTPD_CONF_DIR for how this
|
|
# is added in httpd server
|
|
- ./etc/${HTTPD_SERVER}:/etc/${HTTPD_SERVER}
|
|
|
|
# Mount user-defined httpd log
|
|
# @see ./etc/${HTTPD_SERVER}/*.conf for log defines
|
|
- ./log/${HTTPD_SERVER}:/var/log/${HTTPD_SERVER}
|
|
|
|
# Mount custom intranet
|
|
# (configured in /etc/${HTTPD_SERVER}/01-vhost-default.conf)
|
|
- ./www:/var/www/default
|
|
|
|
# Mount custom mass virtual hosting
|
|
# (configured in /etc/${HTTPD_SERVER}/02-vhost-mass.conf)
|
|
- ${HOST_PATH_TO_WWW_DOCROOTS}:/shared/httpd
|
|
|
|
links:
|
|
# ---- Format: ----
|
|
# SERVICE [ : ALIAS]
|
|
|
|
- "db:database"
|
|
- "php:php-fpm"
|
|
|
|
|
|
|
|
# ----------------------------------------
|
|
# PHP-FPM
|
|
# ----------------------------------------
|
|
php:
|
|
#image: cytopia/${PHP_SERVER}:1
|
|
image: cytopia/${PHP_SERVER}
|
|
|
|
# Manually build via `docker-compose build`
|
|
#build:
|
|
#context: https://github.com/cytopia/docker-${PHP_SERVER}.git#1
|
|
# context: https://github.com/cytopia/docker-${PHP_SERVER}.git
|
|
|
|
environment:
|
|
|
|
# Show all executed commands during docker entrypoint?
|
|
- DEBUG_COMPOSE_ENTRYPOINT=${DEBUG_COMPOSE_ENTRYPOINT}
|
|
|
|
# Adjust timezone
|
|
- TIMEZONE=${TIMEZONE}
|
|
|
|
##
|
|
## PHP-FPM Listening Port
|
|
##
|
|
- PHP_FPM_PORT=9000
|
|
|
|
##
|
|
## PHP Xdebug
|
|
##
|
|
- PHP_XDEBUG_ENABLE=${PHP_XDEBUG_ENABLE}
|
|
- PHP_XDEBUG_REMOTE_PORT=${PHP_XDEBUG_REMOTE_PORT}
|
|
- PHP_XDEBUG_REMOTE_HOST=${PHP_XDEBUG_REMOTE_HOST}
|
|
|
|
##
|
|
## PHP Tweaks
|
|
##
|
|
- PHP_MAX_EXECUTION_TIME=${PHP_MAX_EXECUTION_TIME}
|
|
- PHP_MAX_INPUT_TIME=${PHP_MAX_INPUT_TIME}
|
|
- PHP_MEMORY_LIMIT=${PHP_MEMORY_LIMIT}
|
|
- PHP_POST_MAX_SIZE=${PHP_POST_MAX_SIZE}
|
|
- PHP_UPLOAD_MAX_FILESIZE=${PHP_UPLOAD_MAX_FILESIZE}
|
|
- PHP_MAX_INPUT_VARS=${PHP_MAX_INPUT_VARS}
|
|
|
|
###
|
|
### PHP Error Handling
|
|
###
|
|
- PHP_ERROR_REPORTING=${PHP_ERROR_REPORTING}
|
|
- PHP_DISPLAY_ERRORS=${PHP_DISPLAY_ERRORS}
|
|
- PHP_TRACK_ERRORS=${PHP_TRACK_ERRORS}
|
|
|
|
##
|
|
## Map remote MySQL Port to 127.0.0.1
|
|
##
|
|
- FORWARD_MYSQL_PORT_TO_LOCALHOST=1
|
|
- MYSQL_REMOTE_ADDR=172.16.238.12
|
|
- MYSQL_REMOTE_PORT=3306
|
|
- MYSQL_LOCAL_PORT=3306
|
|
|
|
##
|
|
## Mount remote MySQL socket file to local disk
|
|
##
|
|
- MOUNT_MYSQL_SOCKET_TO_LOCALDISK=1
|
|
- MYSQL_SOCKET_PATH=/tmp/mysql/mysqld.sock
|
|
|
|
##
|
|
## Additional variables needed by custom intranet
|
|
##
|
|
- HOST_PATH_TO_WWW_DOCROOTS=${HOST_PATH_TO_WWW_DOCROOTS}
|
|
- HOST_PATH_TO_MYSQL_DATADIR=${HOST_PATH_TO_MYSQL_DATADIR}
|
|
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
|
|
|
|
networks:
|
|
app_net:
|
|
ipv4_address: 172.16.238.11
|
|
|
|
volumes:
|
|
# ---- Format: ----
|
|
# HOST-DIRECTORY : DOCKER-DIRECTORY
|
|
|
|
# Mount logs
|
|
- ./log/${PHP_SERVER}:/var/log/php-fpm
|
|
|
|
# Mount MySQL Socket directory
|
|
- ./run/mysql:/tmp/mysql
|
|
|
|
# Mount custom intranet
|
|
# (configured in /etc/${HTTPD_SERVER}/01-vhost-default.conf)
|
|
- ./www:/var/www/default
|
|
|
|
# Mount custom mass virtual hosting
|
|
# (configured in /etc/${HTTPD_SERVER}/02-vhost-mass.conf)
|
|
- ${HOST_PATH_TO_WWW_DOCROOTS}:/shared/httpd
|
|
|
|
|
|
|
|
# ----------------------------------------
|
|
# DATABASE
|
|
# ----------------------------------------
|
|
db:
|
|
#image: cytopia/${MYSQL_SERVER}:1
|
|
image: cytopia/${MYSQL_SERVER}
|
|
|
|
# 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
|
|
|
|
environment:
|
|
|
|
# Show all executed commands during docker entrypoint?
|
|
- DEBUG_COMPOSE_ENTRYPOINT=${DEBUG_COMPOSE_ENTRYPOINT}
|
|
|
|
# Adjust timezone
|
|
- TIMEZONE=${TIMEZONE}
|
|
|
|
|
|
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
|
|
- MYSQL_SOCKET_DIR=/tmp/mysql
|
|
|
|
# Runtime settings
|
|
- MYSQL_GENERAL_LOG=${MYSQL_GENERAL_LOG}
|
|
- MYSQL_INNODB_BUFFER_POOL_SIZE=${MYSQL_INNODB_BUFFER_POOL_SIZE}
|
|
- MYSQL_JOIN_BUFFER_SIZE=${MYSQL_JOIN_BUFFER_SIZE}
|
|
- MYSQL_SORT_BUFFER_SIZE=${MYSQL_SORT_BUFFER_SIZE}
|
|
- MYSQL_READ_RND_BUFFER_SIZE=${MYSQL_READ_RND_BUFFER_SIZE}
|
|
- MYSQL_SYMBOLIC_LINKS=${MYSQL_SYMBOLIC_LINKS}
|
|
- MYSQL_SQL_MODE=${MYSQL_SQL_MODE}
|
|
|
|
ports:
|
|
# [local-machine:]local-port:docker-port
|
|
- "127.0.0.1:3306:3306"
|
|
|
|
networks:
|
|
app_net:
|
|
ipv4_address: 172.16.238.12
|
|
|
|
volumes:
|
|
# ---- Format: ----
|
|
# HOST-DIRECTORY : DOCKER-DIRECTORY
|
|
|
|
# Mount logs
|
|
- ./log/${MYSQL_SERVER}:/var/log/mysql
|
|
|
|
# Mount MySQL Socket directory
|
|
- ./run/mysql:/tmp/mysql
|
|
|
|
# Mount MySQL Data directory
|
|
- ${HOST_PATH_TO_MYSQL_DATADIR}:/var/lib/mysql
|
|
|
|
|
|
|
|
################################################################################
|
|
# NETWORK
|
|
################################################################################
|
|
networks:
|
|
app_net:
|
|
driver: bridge
|
|
driver_opts:
|
|
com.docker.network.enable_ipv6: "false"
|
|
ipam:
|
|
driver: default
|
|
config:
|
|
- subnet: 172.16.238.0/24
|
|
gateway: 172.16.238.1
|