Skip to content
Closed
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
12 changes: 11 additions & 1 deletion docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,16 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
echo >&2 "WARNING: $PWD is not empty - press Ctrl+C now if this is an error!"
( set -x; ls -A; sleep 10 )
fi
WP_CONTENT_EXCLUDE=
if [ -n $NO_WP_CONTENT ]; then
WP_CONTENT_EXCLUDE="--exclude=./wp-content/* --no-overwrite-dir"
fi
tar --create \
--file - \
--one-file-system \
--directory /usr/src/wordpress \
--owner "$user" --group "$group" \
. | tar --extract --file -
. | tar --extract $WP_CONTENT_EXCLUDE --file -
echo >&2 "Complete! WordPress has been successfully copied to $PWD"
if [ ! -e .htaccess ]; then
# NOTE: The "Indexes" option is disabled in the php:apache base image
Expand Down Expand Up @@ -122,6 +126,12 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
: "${WORDPRESS_DB_PASSWORD:=}"
: "${WORDPRESS_DB_NAME:=wordpress}"

if [ -e wp-config.php ] && [ "${AUTO_CONFIG:-0}" == 1 ]; then
exec "$@"
fi
if [ -e wp-config.php ] && [ ! -w wp-config.php ]; then
exec "$@"
fi
# version 4.4.1 decided to switch to windows line endings, that breaks our seds and awks
# https://github.com/docker-library/wordpress/issues/116
# https://github.com/WordPress/WordPress/commit/1acedc542fba2482bab88ec70d4bea4b997a92e4
Expand Down