-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-entrypoint.sh
executable file
·56 lines (44 loc) · 1.12 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
53
54
55
56
#!/bin/sh
set -e
isCommand() {
if [ "$1" = "sh" ]; then
return 1
fi
expose help --no-interaction "$1" > /dev/null 2>&1
}
# check if the first argument passed in looks like a flag or command
if [ "${1#-}" != "$1" ] || isCommand "$1"; then
set -- expose "$@"
fi
## check if the first argument passed in is expose and if it's the only one
if [ "$#" = 1 ] && [ "$1" = "expose" ]; then
if [ -n "${SHARE}" ]; then
set -- "$@" "share" "${SHARE}"
fi
if [ -n "${SUBDOMAIN}" ]; then
set -- "$@" "--subdomain=${SUBDOMAIN}"
fi
if [ -n "${AUTH_TOKEN}" ]; then
set -- "$@" "--auth=${AUTH_TOKEN}"
fi
if [ -n "${BASIC_AUTH}" ]; then
set -- "$@" "--basicAuth=${BASIC_AUTH}"
fi
if [ -n "${DNS_SERVER}" ]; then
set -- "$@" "--dns=${DNS_SERVER}"
fi
if [ -n "${DOMAIN}" ]; then
set -- "$@" "--domain=${DOMAIN}"
fi
if [ -n "${SERVER}" ]; then
set -- "$@" "--server=${SERVER}"
fi
if [ -n "${SERVER_HOST}" ]; then
set -- "$@" "--server-host=${SERVER_HOST}"
fi
if [ -n "${SERVER_PORT}" ]; then
set -- "$@" "--server-port=${SERVER_PORT}"
fi
fi
set -- tini -- "$@"
exec "$@"