|
1 | 1 | #!/bin/bash
|
2 | 2 | set -e
|
3 | 3 |
|
| 4 | +DB_PORT=${DB_PORT:-3306} |
| 5 | + |
4 | 6 | echoerr() { echo "$@" 1>&2; }
|
5 | 7 |
|
6 | 8 | if [ ! -f '/var/www/BookStack/.env' ]; then
|
7 | | - if [ "$DB_HOST"]; then |
| 9 | + if [[ "${DB_HOST}" ]]; then |
8 | 10 | cat > /var/www/BookStack/.env <<EOF
|
9 | 11 | # Environment
|
10 | 12 | APP_ENV=production
|
@@ -77,8 +79,7 @@ if [ ! -f '/var/www/BookStack/.env' ]; then
|
77 | 79 | # URL used for social login redirects, NO TRAILING SLASH
|
78 | 80 | EOF
|
79 | 81 | 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' |
82 | 83 | exit 1
|
83 | 84 | fi
|
84 | 85 | fi
|
|
0 commit comments