mirror of
https://github.com/cytopia/devilbox.git
synced 2025-01-18 02:40:04 +00:00
REL-0.9 Update docker-compose
This commit is contained in:
parent
e1fe843299
commit
1c7c240874
@ -1,357 +0,0 @@
|
||||
##
|
||||
## -------------------------
|
||||
## | 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:
|
||||
# TODO: remove latest, once it is ready for the next release
|
||||
image: cytopia/${HTTPD_SERVER}:latest
|
||||
|
||||
# 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
|
||||
- "${LOCAL_LISTEN_ADDR}${HOST_PORT_HTTPD}: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)
|
||||
- ${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
|
||||
|
||||
# Mount custom intranet
|
||||
# (configured in /etc/${HTTPD_SERVER}/01-vhost-default.conf)
|
||||
- ${DEVILBOX_PATH}/.devilbox/www:/var/www/default:ro
|
||||
|
||||
# Mount user-defined httpd log
|
||||
# @see ./etc/${HTTPD_SERVER}/*.conf for log defines
|
||||
- ${DEVILBOX_PATH}/log/${HTTPD_SERVER}:/var/log/${HTTPD_SERVER}
|
||||
|
||||
# Mount custom mass virtual hosting
|
||||
# (configured in /etc/${HTTPD_SERVER}/02-vhost-mass.conf)
|
||||
- ${HOST_PATH_TO_WWW_DOCROOTS}:/shared/httpd:ro
|
||||
|
||||
depends_on:
|
||||
- php
|
||||
|
||||
|
||||
# ----------------------------------------
|
||||
# PHP-FPM
|
||||
# ----------------------------------------
|
||||
php:
|
||||
# TODO: remove latest, once it is ready for the next release
|
||||
image: cytopia/${PHP_SERVER}:latest
|
||||
|
||||
# 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 Xdebug
|
||||
##
|
||||
- PHP_XDEBUG_ENABLE=${PHP_XDEBUG_ENABLE}
|
||||
- PHP_XDEBUG_REMOTE_PORT=${PHP_XDEBUG_REMOTE_PORT}
|
||||
- PHP_XDEBUG_REMOTE_HOST=${PHP_XDEBUG_REMOTE_HOST}
|
||||
|
||||
##
|
||||
## Postfix on
|
||||
##
|
||||
- ENABLE_MAIL=1
|
||||
|
||||
##
|
||||
## 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
|
||||
|
||||
##
|
||||
## Map remote PostgreSQL Port to 127.0.0.1
|
||||
##
|
||||
# TODO
|
||||
|
||||
##
|
||||
## Mount remote PostgreSQL socket file to local disk
|
||||
##
|
||||
# TODO
|
||||
|
||||
##
|
||||
## Additional variables needed by custom intranet
|
||||
##
|
||||
- HOST_PATH_TO_WWW_DOCROOTS=${HOST_PATH_TO_WWW_DOCROOTS}
|
||||
- HOST_PORT_HTTPD=${HOST_PORT_HTTPD}
|
||||
- HOST_PATH_TO_MYSQL_DATADIR=${HOST_PATH_TO_MYSQL_DATADIR}
|
||||
- HOST_PATH_TO_POSTGRES_DATADIR=${HOST_PATH_TO_POSTGRES_DATADIR}
|
||||
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
|
||||
- POSTGRES_USER=${POSTGRES_USER}
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||
# Server versions
|
||||
- PHP_SERVER=${PHP_SERVER}
|
||||
- HTTPD_SERVER=${HTTPD_SERVER}
|
||||
- POSTGRES_SERVER=${POSTGRES_SERVER}
|
||||
- MYSQL_SERVER=${MYSQL_SERVER}
|
||||
|
||||
##
|
||||
## Register optional enabled docker containers to PHP
|
||||
##
|
||||
- COMPOSE_OPTIONAL=1
|
||||
|
||||
|
||||
networks:
|
||||
app_net:
|
||||
ipv4_address: 172.16.238.11
|
||||
|
||||
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
|
||||
|
||||
# Mount logs
|
||||
- ${DEVILBOX_PATH}/log/${PHP_SERVER}:/var/log/php-fpm
|
||||
|
||||
# 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
|
||||
|
||||
|
||||
# Mount custom mass virtual hosting
|
||||
# (configured in /etc/${HTTPD_SERVER}/02-vhost-mass.conf)
|
||||
- ${HOST_PATH_TO_WWW_DOCROOTS}:/shared/httpd
|
||||
|
||||
depends_on:
|
||||
- mysql
|
||||
- postgres
|
||||
- redis
|
||||
|
||||
|
||||
# ----------------------------------------
|
||||
# DATABASE
|
||||
# ----------------------------------------
|
||||
mysql:
|
||||
# TODO: remove latest, once it is ready for the next release
|
||||
image: cytopia/${MYSQL_SERVER}:latest
|
||||
|
||||
# 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}
|
||||
|
||||
ports:
|
||||
# [local-machine:]local-port:docker-port
|
||||
- "${LOCAL_LISTEN_ADDR}${HOST_PORT_MYSQL}:3306"
|
||||
|
||||
networks:
|
||||
app_net:
|
||||
ipv4_address: 172.16.238.12
|
||||
|
||||
volumes:
|
||||
# ---- Format: ----
|
||||
# HOST-DIRECTORY : DOCKER-DIRECTORY
|
||||
|
||||
# Mount logs
|
||||
- ${DEVILBOX_PATH}/log/${MYSQL_SERVER}:/var/log/mysql
|
||||
|
||||
# Mount MySQL Socket directory
|
||||
- mysql_socket_volume:/tmp/mysql
|
||||
|
||||
# Mount devilbox default overwrites
|
||||
- ${DEVILBOX_PATH}/.devilbox/etc/${MYSQL_SERVER}:/etc/mysql/docker-default.d:ro
|
||||
|
||||
# Mount devilbox user-defined cnf files in order
|
||||
# to overwrite the MySQL server configuration
|
||||
- ${DEVILBOX_PATH}/cfg/${MYSQL_SERVER}:/etc/mysql/conf.d:ro
|
||||
|
||||
# Mount MySQL Data directory
|
||||
- ${HOST_PATH_TO_MYSQL_DATADIR}/${MYSQL_SERVER}:/var/lib/mysql
|
||||
|
||||
|
||||
# ----------------------------------------
|
||||
# POSTGRES
|
||||
# ----------------------------------------
|
||||
postgres:
|
||||
image: postgres:${POSTGRES_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:
|
||||
|
||||
- POSTGRES_USER=${POSTGRES_USER}
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||
- PGDATA=/var/lib/postgresql/data/pgdata
|
||||
|
||||
ports:
|
||||
# [local-machine:]local-port:docker-port
|
||||
- "${LOCAL_LISTEN_ADDR}${HOST_PORT_POSTGRES}:5432"
|
||||
|
||||
networks:
|
||||
app_net:
|
||||
ipv4_address: 172.16.238.13
|
||||
|
||||
volumes:
|
||||
# ---- Format: ----
|
||||
# HOST-DIRECTORY : DOCKER-DIRECTORY
|
||||
|
||||
# Mount logs
|
||||
- ${DEVILBOX_PATH}/log/postgres-${POSTGRES_SERVER}:/var/log/postgresql
|
||||
|
||||
# Mount PostgreSQL Socket directory
|
||||
- pgsql_socket_volume:/var/run/postgresql
|
||||
|
||||
# Mount PostgreSQL Data directory
|
||||
- ${HOST_PATH_TO_POSTGRES_DATADIR}/${POSTGRES_SERVER}:/var/lib/postgresql/data/pgdata
|
||||
|
||||
|
||||
# ----------------------------------------
|
||||
# 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
|
||||
|
||||
|
||||
################################################################################
|
||||
# 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:
|
||||
|
||||
|
||||
################################################################################
|
||||
# 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
|
@ -31,7 +31,7 @@ services:
|
||||
# ----------------------------------------
|
||||
php:
|
||||
# TODO: remove latest, once it is ready for the next release
|
||||
image: cytopia/${PHP_SERVER}:latest
|
||||
image: cytopia/${PHP_SERVER}:release-0.9
|
||||
|
||||
# Manually build via `docker-compose build`
|
||||
#build:
|
||||
@ -71,14 +71,19 @@ services:
|
||||
##
|
||||
## Enable 127.0.0.1 Port-forwarding
|
||||
##
|
||||
- FORWARD_PORTS_TO_LOCALHOST=3306:mysql:3306,5432:pgsql:5432,6379:redis:6379
|
||||
- FORWARD_PORTS_TO_LOCALHOST=3306:mysql:3306,5432:pgsql:5432,6379:redis:6379,11211:memcached:11211
|
||||
|
||||
##
|
||||
## Additional variables to announce to intranet/php-container
|
||||
##
|
||||
# Ports
|
||||
- LOCAL_LISTEN_ADDR
|
||||
- HOST_PORT_HTTPD
|
||||
# Paths
|
||||
- HOST_PORT_MYSQL
|
||||
- HOST_PORT_PGSQL
|
||||
- HOST_PORT_REDIS
|
||||
- HOST_PORT_MEMCACHED
|
||||
# Data dir paths
|
||||
- HOST_PATH_HTTPD_DATADIR
|
||||
- HOST_PATH_MYSQL_DATADIR
|
||||
- HOST_PATH_PGSQL_DATADIR
|
||||
@ -92,6 +97,7 @@ services:
|
||||
- PGSQL_SERVER
|
||||
- MYSQL_SERVER
|
||||
- REDIS_SERVER
|
||||
- MEMCACHED_SERVER
|
||||
|
||||
networks:
|
||||
app_net:
|
||||
@ -109,7 +115,7 @@ services:
|
||||
- ${DEVILBOX_PATH}/log/${PHP_SERVER}:/var/log/php
|
||||
|
||||
# Mount MySQL Socket directory
|
||||
- mysql_socket_volume:/tmp/mysql
|
||||
- vol_mysql_sock:/tmp/mysql
|
||||
|
||||
# Mount Mail directory
|
||||
#- ${DEVILBOX_PATH}/run/mail:/var/mail
|
||||
@ -254,7 +260,7 @@ services:
|
||||
- ${DEVILBOX_PATH}/log/${MYSQL_SERVER}:/var/log/mysql
|
||||
|
||||
# Mount MySQL Socket directory
|
||||
- mysql_socket_volume:/tmp/mysql
|
||||
- vol_mysql_sock:/tmp/mysql
|
||||
|
||||
# Mount devilbox default overwrites
|
||||
- ${DEVILBOX_PATH}/.devilbox/etc/${MYSQL_SERVER}:/etc/mysql/docker-default.d:ro
|
||||
@ -265,6 +271,7 @@ services:
|
||||
|
||||
# Mount MySQL Data directory
|
||||
- ${HOST_PATH_MYSQL_DATADIR}/${MYSQL_SERVER}:/var/lib/mysql
|
||||
|
||||
depends_on:
|
||||
- php
|
||||
- httpd
|
||||
@ -300,13 +307,14 @@ services:
|
||||
# HOST-DIRECTORY : DOCKER-DIRECTORY
|
||||
|
||||
# Mount logs
|
||||
- ${DEVILBOX_PATH}/log/postgres-${PGSQL_SERVER}:/var/log/postgresql
|
||||
- ${DEVILBOX_PATH}/log/pgsql-${PGSQL_SERVER}:/var/log/postgresql
|
||||
|
||||
# Mount PostgreSQL Socket directory
|
||||
- pgsql_socket_volume:/var/run/postgresql
|
||||
- vol_pgsql_sock:/var/run/postgresql
|
||||
|
||||
# Mount PostgreSQL Data directory
|
||||
- ${HOST_PATH_PGSQL_DATADIR}/${PGSQL_SERVER}:/var/lib/postgresql/data/pgdata
|
||||
|
||||
depends_on:
|
||||
- php
|
||||
- httpd
|
||||
@ -332,6 +340,33 @@ services:
|
||||
|
||||
# Mount logs
|
||||
- ${DEVILBOX_PATH}/log/redis-${REDIS_SERVER}:/var/log/redis
|
||||
|
||||
depends_on:
|
||||
- php
|
||||
- httpd
|
||||
|
||||
|
||||
# ----------------------------------------
|
||||
# Memcached
|
||||
# ----------------------------------------
|
||||
memcached:
|
||||
image: memcached:${MEMCACHED_SERVER}
|
||||
|
||||
ports:
|
||||
# [local-machine:]local-port:docker-port
|
||||
- "${LOCAL_LISTEN_ADDR}${HOST_PORT_MEMCACHED}:11211"
|
||||
|
||||
networks:
|
||||
app_net:
|
||||
ipv4_address: 172.16.238.15
|
||||
|
||||
volumes:
|
||||
# ---- Format: ----
|
||||
# HOST-DIRECTORY : DOCKER-DIRECTORY
|
||||
|
||||
# Mount logs
|
||||
- ${DEVILBOX_PATH}/log/memcached-${MEMCACHED_SERVER}:/var/log/memcached
|
||||
|
||||
depends_on:
|
||||
- php
|
||||
- httpd
|
||||
@ -344,12 +379,12 @@ 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:
|
||||
vol_mysql_sock:
|
||||
|
||||
# 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:
|
||||
vol_pgsql_sock:
|
||||
|
||||
|
||||
################################################################################
|
||||
|
Loading…
Reference in New Issue
Block a user