forked from solidnerd/docker-bookstack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-entrypoint.sh
executable file
·48 lines (39 loc) · 1.1 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
#!/bin/bash
set -e
echoerr() { echo "$@" 1>&2; }
check_vars_exist() {
var_names=("$@")
for var_name in "${var_names[@]}"; do
if [ -z "${!var_name}" ]; then
echoerr "error: missing ${var_name} environment variable"
exit 1
fi
done
}
# Ensure there is no local .env file
if [ -f ".env" ]; then
mv .env .env.bak
echoerr ".env file detected - moved to .env.bak"
echoerr "Please update your configuration to use environment variables in the container!"
fi
# Check a number of essential variables are set
check_vars_exist \
APP_KEY \
APP_URL \
DB_DATABASE \
DB_PASSWORD \
DB_USERNAME \
DB_SOCKET
if [ -n "${FILE_UPLOAD_SIZE_LIMITS}" ]; then
echo "Note: If you're setting FILE_UPLOAD_SIZE_LIMITS to more than 10M, you"
echo "may also need to modify the php.ini file."
echo "See:"
echo "https://github.com/solidnerd/docker-bookstack/issues/423"
fi
echo "Starting Migration..."
#php artisan migrate --force
echo "Clearing caches..."
php artisan cache:clear
php artisan view:clear
trap "echo Catching SIGWINCH apache error and perventing it." SIGWINCH
exec apache2-foreground