-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-entrypoint.sh
executable file
·52 lines (42 loc) · 1.21 KB
/
docker-entrypoint.sh
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
52
#!/usr/bin/env bash
set -e
if [ "$1" = 'httpd' ]; then
if [ -d /tmp/metacatui/ ];
then
# Now copy the metacatui files over
echo "************************************"
echo "Found /tmp/metacatui. Copying files"
echo "************************************"
cp -rfv /tmp/metacatui/* .
fi
if [ -f /tmp/robots.tmpl ];
then
# Defaults to disallow
export ROBOT_RULE=${ROBOT_RULE:-Disallow}
envsubst < /tmp/robots.tmpl > robots.txt
test -f robots.txt
fi
if [ "$ENABLE_SSL" == "1" ];
then
EXTRA_ARGS="-D EnableSSL"
fi
if [ "$ENABLE_REVERSE_PROXY" == "1" ];
then
EXTRA_ARGS="$EXTRA_ARGS -D EnableReverseProxy"
fi
if [ "$ENABLE_REAL_IP" == "1" ];
then
# HTTPS termination confir (real ip)
#
# When using ssl termination, we need to inject proxy headers, and
# then configure Apache with the IP address range of the proxy to
# trust
EXTRA_ARGS="$EXTRA_ARGS -D EnableRealIp"
fi
if [ "${ENABLE_LOG_OUTPUT}" != "0" ];
then
# Output the logs to files
EXTRA_ARGS="$EXTRA_ARGS -D EnableLogOutput"
fi
fi
exec $@ $EXTRA_ARGS