-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathentrypoint
34 lines (25 loc) · 897 Bytes
/
entrypoint
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
#!/bin/sh
set -e
if [ "$ENABLE_XDEBUG" == "true" ]; then
docker-php-ext-enable xdebug >> /dev/null 2>&1
if [ $? != "0" ]; then
echo "[ERROR] An error happened enabling xdebug"
exit 1
fi
fi
# Run as current user
CURRENT_USER=${ASUSER:-${UID:-0}}
if [ ! -z "$CURRENT_USER" ] && [ "$CURRENT_USER" != "0" ]; then
usermod -u $CURRENT_USER kool
fi
dockerize -template /kool/kool.tmpl:/usr/local/etc/php/conf.d/kool.ini -template /kool/zz-docker.tmpl:/usr/local/etc/php-fpm.d/zz-docker.conf -template /kool/default.tmpl:/etc/nginx/conf.d/default.conf
/kool/30-tune-worker-processes.sh
# Run entrypoint if provided
if [ ! -z "$ENTRYPOINT" ] && [ -f "$ENTRYPOINT" ]; then
bash $ENTRYPOINT
fi
if [ "$1" = "sh" ] || [ "$1" = "bash" ] || [ "$1" = "php-fpm" ] || [ "$1" = "nginx" ] || [ "$1" = "supervisord" ]; then
exec "$@"
else
exec su-exec kool "$@"
fi