Skip to content

Commit e8606a6

Browse files
author
Raphaël Droz
authored
make wp-content/wp-config.php overwrite optional
make wp-content/wp-config.php overwrite optional
1 parent 59f3b51 commit e8606a6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

docker-entrypoint.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,16 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
4646
echo >&2 "WARNING: $PWD is not empty - press Ctrl+C now if this is an error!"
4747
( set -x; ls -A; sleep 10 )
4848
fi
49+
WP_CONTENT_EXCLUDE=
50+
if [ -n $NO_WP_CONTENT ]; then
51+
WP_CONTENT_EXCLUDE="--exclude=./wp-content/*"
52+
fi
4953
tar --create \
5054
--file - \
5155
--one-file-system \
5256
--directory /usr/src/wordpress \
5357
--owner "$user" --group "$group" \
54-
. | tar --extract --file -
58+
. | tar --extract $WP_CONTENT_EXCLUDE --file -
5559
echo >&2 "Complete! WordPress has been successfully copied to $PWD"
5660
if [ ! -e .htaccess ]; then
5761
# NOTE: The "Indexes" option is disabled in the php:apache base image
@@ -122,6 +126,9 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
122126
: "${WORDPRESS_DB_PASSWORD:=}"
123127
: "${WORDPRESS_DB_NAME:=wordpress}"
124128

129+
if [ -e wp-config.php && -n $NO_AUTO_CONFIG ]; then
130+
exec "$@"
131+
fi
125132
# version 4.4.1 decided to switch to windows line endings, that breaks our seds and awks
126133
# https://github.com/docker-library/wordpress/issues/116
127134
# https://github.com/WordPress/WordPress/commit/1acedc542fba2482bab88ec70d4bea4b997a92e4

0 commit comments

Comments
 (0)