File tree 3 files changed +3
-51
lines changed
3 files changed +3
-51
lines changed Original file line number Diff line number Diff line change 2
2
set -e
3
3
4
4
if [[ " $1 " == apache2* ]] || [ " $1 " == php-fpm ]; then
5
- if [ -n " $MYSQL_PORT_3306_TCP " ]; then
6
- if [ -z " $WORDPRESS_DB_HOST " ]; then
7
- WORDPRESS_DB_HOST=' mysql'
8
- else
9
- echo >&2 ' warning: both WORDPRESS_DB_HOST and MYSQL_PORT_3306_TCP found'
10
- echo >&2 " Connecting to WORDPRESS_DB_HOST ($WORDPRESS_DB_HOST )"
11
- echo >&2 ' instead of the linked mysql container'
12
- fi
13
- fi
14
-
15
- if [ -z " $WORDPRESS_DB_HOST " ]; then
16
- echo >&2 ' error: missing WORDPRESS_DB_HOST and MYSQL_PORT_3306_TCP environment variables'
17
- echo >&2 ' Did you forget to --link some_mysql_container:mysql or set an external db'
18
- echo >&2 ' with -e WORDPRESS_DB_HOST=hostname:port?'
19
- exit 1
20
- fi
21
-
5
+ : " ${WORDPRESS_DB_HOST:= mysql} "
22
6
# if we're linked to MySQL and thus have credentials already, let's use them
23
7
: ${WORDPRESS_DB_USER:= ${MYSQL_ENV_MYSQL_USER:- root} }
24
8
if [ " $WORDPRESS_DB_USER " = ' root' ]; then
Original file line number Diff line number Diff line change 2
2
set -e
3
3
4
4
if [[ " $1 " == apache2* ]] || [ " $1 " == php-fpm ]; then
5
- if [ -n " $MYSQL_PORT_3306_TCP " ]; then
6
- if [ -z " $WORDPRESS_DB_HOST " ]; then
7
- WORDPRESS_DB_HOST=' mysql'
8
- else
9
- echo >&2 ' warning: both WORDPRESS_DB_HOST and MYSQL_PORT_3306_TCP found'
10
- echo >&2 " Connecting to WORDPRESS_DB_HOST ($WORDPRESS_DB_HOST )"
11
- echo >&2 ' instead of the linked mysql container'
12
- fi
13
- fi
14
-
15
- if [ -z " $WORDPRESS_DB_HOST " ]; then
16
- echo >&2 ' error: missing WORDPRESS_DB_HOST and MYSQL_PORT_3306_TCP environment variables'
17
- echo >&2 ' Did you forget to --link some_mysql_container:mysql or set an external db'
18
- echo >&2 ' with -e WORDPRESS_DB_HOST=hostname:port?'
19
- exit 1
20
- fi
21
-
5
+ : " ${WORDPRESS_DB_HOST:= mysql} "
22
6
# if we're linked to MySQL and thus have credentials already, let's use them
23
7
: ${WORDPRESS_DB_USER:= ${MYSQL_ENV_MYSQL_USER:- root} }
24
8
if [ " $WORDPRESS_DB_USER " = ' root' ]; then
Original file line number Diff line number Diff line change 2
2
set -e
3
3
4
4
if [[ " $1 " == apache2* ]] || [ " $1 " == php-fpm ]; then
5
- if [ -n " $MYSQL_PORT_3306_TCP " ]; then
6
- if [ -z " $WORDPRESS_DB_HOST " ]; then
7
- WORDPRESS_DB_HOST=' mysql'
8
- else
9
- echo >&2 ' warning: both WORDPRESS_DB_HOST and MYSQL_PORT_3306_TCP found'
10
- echo >&2 " Connecting to WORDPRESS_DB_HOST ($WORDPRESS_DB_HOST )"
11
- echo >&2 ' instead of the linked mysql container'
12
- fi
13
- fi
14
-
15
- if [ -z " $WORDPRESS_DB_HOST " ]; then
16
- echo >&2 ' error: missing WORDPRESS_DB_HOST and MYSQL_PORT_3306_TCP environment variables'
17
- echo >&2 ' Did you forget to --link some_mysql_container:mysql or set an external db'
18
- echo >&2 ' with -e WORDPRESS_DB_HOST=hostname:port?'
19
- exit 1
20
- fi
21
-
5
+ : " ${WORDPRESS_DB_HOST:= mysql} "
22
6
# if we're linked to MySQL and thus have credentials already, let's use them
23
7
: ${WORDPRESS_DB_USER:= ${MYSQL_ENV_MYSQL_USER:- root} }
24
8
if [ " $WORDPRESS_DB_USER " = ' root' ]; then
You can’t perform that action at this time.
0 commit comments