Skip to content

Fix DB_PORT #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 26, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/bin/bash
set -e

DB_PORT=${DB_PORT:-3306}

echoerr() { echo "$@" 1>&2; }

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