Skip to content

Instantly share code, notes, and snippets.

@tmort
Last active October 22, 2019 15:25
Show Gist options
  • Save tmort/b0fe11c919ef3a527f70e1d99f631e76 to your computer and use it in GitHub Desktop.
Save tmort/b0fe11c919ef3a527f70e1d99f631e76 to your computer and use it in GitHub Desktop.
Devilbox Override to replace devilbox/docker-apache-2.4 with sixfoot3/docker-apache-2.4
# IMPORTANT: The version must match the version of docker-compose.yml
version: '2.1'
services:
# ------------------------------------------------------------
# Web Server
# ------------------------------------------------------------
httpd:
image: sixfoot3/docker-apache-2.4:latest
hostname: httpd
environment:
##
## Debug/Logging
##
- DEBUG_ENTRYPOINT=${DEBUG_COMPOSE_ENTRYPOINT}
- DEBUG_RUNTIME=${DEBUG_COMPOSE_ENTRYPOINT}
- DOCKER_LOGS
##
## Adjust timezone
##
- TIMEZONE
##
## UserID and GroupID
##
- NEW_UID
- NEW_GID
##
## Nginx specific worker/connection settings
##
- WORKER_PROCESSES=${HTTPD_NGINX_WORKER_PROCESSES:-auto}
- WORKER_CONNECTIONS=${HTTPD_NGINX_WORKER_CONNECTIONS:-1024}
##
## Disable default vhost?
##
- MAIN_VHOST_ENABLE=${DEVILBOX_UI_ENABLE}
- MAIN_VHOST_STATUS_ENABLE=1
- MAIN_VHOST_STATUS_ALIAS=/devilbox-httpd-status
- MAIN_VHOST_SSL_TYPE=both
- MAIN_VHOST_SSL_GEN=1
- MAIN_VHOST_SSL_CN=${DEVILBOX_UI_SSL_CN:-localhost}
##
## SSL GEN Settings
##
- MAIN_VHOST_SSL_VALIDITY_PERIOD=${SSL_VALIDITY_PERIOD:-802}
##
## Enable Mass Vhosts
##
- MASS_VHOST_ENABLE=1
- MASS_VHOST_TLD=.${TLD_SUFFIX}
- MASS_VHOST_DOCROOT=${HTTPD_DOCROOT_DIR}
- MASS_VHOST_TPL=${HTTPD_TEMPLATE_DIR}
- MASS_VHOST_SSL_TYPE=both
- MASS_VHOST_SSL_GEN=1
##
## PHP-FPM Remote Server
##
- COMPAT=${PHP_SERVER}
- PHP_FPM_ENABLE=1
- PHP_FPM_SERVER_ADDR=php
- PHP_FPM_SERVER_PORT=9000
- PHP_FPM_TIMEOUT=${HTTPD_TIMEOUT_TO_PHP_FPM:-180}
ports:
# ---- Format: ----
# [HOST-ADDR : ] HOST-PORT : DOCKER-PORT
- "${LOCAL_LISTEN_ADDR}${HOST_PORT_HTTPD}:80"
- "${LOCAL_LISTEN_ADDR}${HOST_PORT_HTTPD_SSL}:443"
networks:
app_net:
ipv4_address: 172.16.238.11
volumes:
# ---- Format: ----
# HOST-DIRECTORY : DOCKER-DIRECTORY
# Mount custom intranet
- ${DEVILBOX_PATH}/.devilbox/www:/var/www/default:ro${MOUNT_OPTIONS}
# Mount custom mass virtual hosting
- ${HOST_PATH_HTTPD_DATADIR}:/shared/httpd:rw${MOUNT_OPTIONS}
# Mount custom web server config directory
- ${DEVILBOX_PATH}/cfg/${HTTPD_SERVER}:/etc/httpd-custom.d:rw${MOUNT_OPTIONS}
# Mount custom vhost-templates
- ${DEVILBOX_PATH}/cfg/vhost-gen:/etc/vhost-gen.d:rw${MOUNT_OPTIONS}
# Mount logs
- ${DEVILBOX_PATH}/log/${HTTPD_SERVER}:/var/log/${HTTPD_SERVER}:rw${MOUNT_OPTIONS}
# Certificate Authority public key
- ${DEVILBOX_PATH}/ca:/ca:rw${MOUNT_OPTIONS}
depends_on:
- bind
- php
@tmort
Copy link
Author

tmort commented Oct 22, 2019

The only change between the default HTTPD and this version (which overrides when placed in the root devilbox directory) is line #9, which points to a custom docker hub repository. This repo can be found here https://github.com/tmort/docker-apache-2.4 and includes a temporary fix for Mac OS Catalina and the SSL certificate generation. Read more here: cytopia/devilbox#640

@tmort
Copy link
Author

tmort commented Oct 22, 2019

  1. Update: sixfoot3/docker-apache-2.4:latest from Docker Hub.
  2. Adding variable MAIN_VHOST_SSL_VALIDITY_PERIOD which exposes a value to the docker image for the validity period. This can be set in the .env file via the following:
# ...the rest of your .env above. I included this in the bottom of my .env file.
SSL_VALIDITY_PERIOD=799

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment