-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathdocker-entrypoint
executable file
·45 lines (36 loc) · 1.52 KB
/
docker-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
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
set -e
if [[ "$1" == apache2* ]] && [ "${FWD_REMOTE_IP,,}" == "true" ]; then
a2enmod remoteip -q
echo 'RemoteIPHeader X-Forwarded-For' > $APACHE_CONFDIR/conf-available/docker-ci-apache.conf
a2enconf docker-oc-apache -q
fi
if [ "${ENABLE_CRON,,}" == "true" ]; then
cron
echo 'Cron enabled.'
fi
if [ ! -z "$PHP_DISPLAY_ERRORS" ]; then
echo "php.ini set display_errors=$PHP_DISPLAY_ERRORS"
sed -i "/display_errors=*/c\display_errors=$PHP_DISPLAY_ERRORS" /usr/local/etc/php/conf.d/docker-ci-php.ini
fi
if [ ! -z "$PHP_POST_MAX_SIZE" ]; then
echo "php.ini set post_max_size=$PHP_POST_MAX_SIZE"
sed -i "/post_max_size=*/c\post_max_size=$PHP_POST_MAX_SIZE" /usr/local/etc/php/conf.d/docker-ci-php.ini
fi
if [ ! -z "$PHP_MEMORY_LIMIT" ]; then
echo "php.ini set memory_limit=$PHP_MEMORY_LIMIT"
sed -i "/memory_limit=*/c\memory_limit=$PHP_MEMORY_LIMIT" /usr/local/etc/php/conf.d/docker-ci-php.ini
fi
if [ ! -z "$PHP_UPLOAD_MAX_FILESIZE" ]; then
echo "php.ini set upload_max_filesize=$PHP_UPLOAD_MAX_FILESIZE"
sed -i "/upload_max_filesize=*/c\upload_max_filesize=$PHP_UPLOAD_MAX_FILESIZE" /usr/local/etc/php/conf.d/docker-ci-php.ini
fi
if [ ! -z "$TZ" ]; then
echo "php.ini set date.timezone=$TZ"
sed -i "/date.timezone=*/c\date.timezone=$TZ" /usr/local/etc/php/conf.d/docker-ci-php.ini
fi
if [[ "$1" == apache2* ]] && [ -z "$(ls -A /var/www/html)" ]; then
echo "Document root (/var/www/html) is empty. Copying CodeIgniter User Guide..."
mv /usr/src/CodeIgniter_1.7.3/user_guide/* /var/www/html/.
fi
exec "$@"