Skip to content

Commit 91b3e48

Browse files
committed
Fix DB_PORT
This fixes the DB_PORT if it’s not set it will be the default mysql port. Otherwise you can override it with DB_PORT as environment variable.
1 parent aebcb4f commit 91b3e48

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

docker-entrypoint.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
#!/bin/bash
22
set -e
33

4+
DB_PORT=${DB_PORT:-3306}
5+
46
echoerr() { echo "$@" 1>&2; }
57

68
if [ ! -f '/var/www/BookStack/.env' ]; then
7-
if [ "$DB_HOST" ]; then
9+
if [[ "${DB_HOST}" ]]; then
810
cat > /var/www/BookStack/.env <<EOF
911
# Environment
1012
APP_ENV=production
@@ -77,8 +79,7 @@ if [ ! -f '/var/www/BookStack/.env' ]; then
7779
# URL used for social login redirects, NO TRAILING SLASH
7880
EOF
7981
else
80-
echo >&2 'warning: missing MYSQL_PORT_3306_TCP environment variables'
81-
echo >&2 ' Did you forget to --link some_mysql_container:mysql ?'
82+
echo >&2 'error: missing DB_PORT or DB_HOST environment variables'
8283
exit 1
8384
fi
8485
fi

0 commit comments

Comments
 (0)