Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ rebuild: pull
docker build --no-cache -t $(image) .
cd build; ./gen-readme.sh $(image)

tag:
docker tag $(image) $(image):$(ARG)

test:
.ci/start-ci.sh $(image) $(ARG)

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ This Docker container adds a lot of injectables in order to customize it to your
| /etc/httpd-custom.d | Mount this directory to add outside configuration files (`*.conf`) to Nginx |
| /var/www/default | Nginx default virtual host base path (contains by default `htdocs/` and `cfg/` |
| /shared/httpd | Nginx mass virtual host root directory |
| /etc/vhost-gen.d | [vhost-gen](https://github.com/devilbox/vhost-gen) directory for custom templates. Copy and customize [nginx.yml](https://github.com/devilbox/vhost-gen/blob/master/etc/templates/nginx.yml) into this mounted directory for global vhost customizations |


#### Default ports
Expand Down
22 changes: 22 additions & 0 deletions data/docker-entrypoint.d/07-vhost-gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,28 @@ set -o pipefail
# Functions
############################################################

###
### Copy custom vhost-gen template
###
vhost_gen_copy_custom_template() {
local input_dir="${1}"
local output_dir="${2}"
local template_name="${3}"
local debug="${4}"

if [ ! -d "${input_dir}" ]; then
run "mkdir -p ${input_dir}" "${debug}"
fi

if [ -f "${input_dir}/${template_name}" ]; then
log "info" "vhost-gen: applying customized global template: ${template_name}" "${debug}"
run "cp ${input_dir}/${template_name} ${output_dir}/${template_name}" "${debug}"
else
log "info" "vhost-gen: no customized template found" "${debug}"
fi
}


###
### Set PHP_FPM
###
Expand Down
8 changes: 8 additions & 0 deletions data/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ CA_CRT=/ca/devilbox-ca.crt

# Path to scripts to source
CONFIG_DIR="/docker-entrypoint.d"
VHOST_GEN_DIR="/etc/vhost-gen/templates"
VHOST_GEN_CUST_DIR="/etc/vhost-gen.d"


# Wait this many seconds to start watcherd after httpd has been started
Expand Down Expand Up @@ -123,6 +125,12 @@ fi
## vhost-gen Configuration
#############################################################

###
### Copy custom vhost-gen template
###
vhost_gen_copy_custom_template "${VHOST_GEN_CUST_DIR}" "${VHOST_GEN_DIR}" "apache22.yml" "${DEBUG_LEVEL}"


###
### Enable and configure PHP-FPM
###
Expand Down