-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-entrypoint.sh
More file actions
executable file
·51 lines (40 loc) · 1.42 KB
/
docker-entrypoint.sh
File metadata and controls
executable file
·51 lines (40 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env bash
set -eo pipefail
if [[ -n "${DEBUG}" ]]; then
set -x
fi
_gotpl() {
if [[ -f "/etc/gotpl/$1" ]]; then
gotpl "/etc/gotpl/$1" >"$2"
fi
}
exec_init_scripts() {
shopt -s nullglob
for f in /docker-entrypoint-init.d/*; do
su -s /bin/bash inr -c ". $f"
done
shopt -u nullglob
}
process_templates() {
_gotpl "docker-php-base.ini.tmpl" "${PHP_INI_DIR}/conf.d/zzz-custom-php.ini"
_gotpl "docker-php-error.ini.tmpl" "${PHP_INI_DIR}/conf.d/docker-php-error.ini"
_gotpl "docker-php-ext-opcache.ini.tmpl" "${PHP_INI_DIR}/conf.d/docker-php-ext-opcache.ini"
_gotpl "docker-php-ext-newrelic.ini.tmpl" "${PHP_INI_DIR}/conf.d/docker-php-ext-newrelic.ini"
if [[ -f "/usr/local/etc/php-fpm.d/www.conf" ]]; then
_gotpl "docker-php-fpm-pool.conf.tmpl" "/usr/local/etc/php-fpm.d/zz-inrage-pool.conf"
fi
if [[ -d "/etc/apache2" ]]; then
_gotpl "docker-apache-servername.conf.tmpl" "/etc/apache2/conf-enabled/servername.conf"
_gotpl "docker-apache-vhost.conf.tmpl" "/etc/apache2/sites-available/000-default.conf"
_gotpl "docker-apache-remoteip.conf.tmpl" "/etc/apache2/conf-enabled/remoteip.conf"
_gotpl "docker-apache-event.conf.tmpl" "/etc/apache2/mpm-overrides/mpm_event.conf"
fi
_gotpl "msmtprc.tmpl" "/etc/msmtprc"
}
process_templates
exec_init_scripts
if [[ "${1}" == "make" ]]; then
exec "${@}" -f /usr/local/bin/actions.mk
else
exec /usr/local/bin/docker-php-entrypoint "${@}"
fi