-
Notifications
You must be signed in to change notification settings - Fork 8
/
start.sh
58 lines (44 loc) · 1.26 KB
/
start.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
57
58
#!/bin/sh
# /etc/nginx/sites-available/moodle
NGINX_CONFIG="/etc/nginx/sites-available/moodle.conf"
DEFAULT_PORT=80
if [ -z "$NGINX_PORT" ]
then
NGINX_PORT="$DEFAULT_PORT"
fi
envsubst '$NGINX_PORT' < $NGINX_CONFIG.template > $NGINX_CONFIG
if [ ! -z "${MOODOLE_MAX_BODY_SIZE}" ]
then
sed -i '/client_max_body_size/c\\tclient_max_body_size '$MOODOLE_MAX_BODY_SIZE';' $NGINX_CONFIG
fi
if [ ! -z "${MOODOLE_BODY_TIMEOUT}" ]
then
sed -i '/client_body_timeout/c\\tclient_body_timeout '$MOODOLE_BODY_TIMEOUT';' $NGINX_CONFIG
fi
# /etc/php7/php-fpm.conf
PHP_FM_CONFIG="/etc/php7/php-fpm.conf"
echo "[www]" >> $PHP_FM_CONFIG
if [ ! -z "${MOODOLE_DB_URL}" ]
then
echo "env[MOODOLE_DB_URL] = '$MOODOLE_DB_URL'" >> $PHP_FM_CONFIG
fi
if [ ! -z "${MOODOLE_DB_NAME}" ]
then
echo "env[MOODOLE_DB_NAME] = '$MOODOLE_DB_NAME'" >> $PHP_FM_CONFIG
fi
if [ ! -z "${MOODOLE_DB_USER}" ]
then
echo "env[MOODOLE_DB_USER] = '$MOODOLE_DB_USER'" >> $PHP_FM_CONFIG
fi
if [ ! -z "${MOODOLE_DB_PASS}" ]
then
echo "env[MOODOLE_DB_PASS] = '$MOODOLE_DB_PASS'" >> $PHP_FM_CONFIG
fi
if [ ! -z "${MOODOLE_DB_PORT}" ]
then
echo "env[MOODOLE_DB_PORT] = '$MOODOLE_DB_PORT'" >> $PHP_FM_CONFIG
fi
/usr/sbin/php-fpm7
/usr/sbin/nginx
touch /var/log/nginx/access.log
tail -f /var/log/nginx/access.log