Skip to content
Merged
Show file tree
Hide file tree
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
27 changes: 24 additions & 3 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,34 @@ file_env() {
}

if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
if [ "$(id -u)" = '0' ]; then
case "$1" in
apache2*)
user="${APACHE_RUN_USER:-www-data}"
group="${APACHE_RUN_GROUP:-www-data}"
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$(id -u)"
group="$(id -g)"
fi

if ! [ -e index.php -a -e wp-includes/version.php ]; then
echo >&2 "WordPress not found in $PWD - copying now..."
if [ "$(ls -A)" ]; then
echo >&2 "WARNING: $PWD is not empty - press Ctrl+C now if this is an error!"
( set -x; ls -A; sleep 10 )
fi
tar cf - --one-file-system -C /usr/src/wordpress . | tar xf -
tar --create \
--file - \
--one-file-system \
--directory /usr/src/wordpress \
--owner "$user" --group "$group" \
. | tar --extract --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 All @@ -46,7 +67,7 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
</IfModule>
# END WordPress
EOF
chown www-data:www-data .htaccess
chown "$user:$group" .htaccess
fi
fi

Expand Down Expand Up @@ -115,7 +136,7 @@ if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROT
}

EOPHP
chown www-data:www-data wp-config.php
chown "$user:$group" wp-config.php
fi

# see http://stackoverflow.com/a/2705678/433558
Expand Down
27 changes: 24 additions & 3 deletions php5.6/apache/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,34 @@ file_env() {
}

if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
if [ "$(id -u)" = '0' ]; then
case "$1" in
apache2*)
user="${APACHE_RUN_USER:-www-data}"
group="${APACHE_RUN_GROUP:-www-data}"
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$(id -u)"
group="$(id -g)"
fi

if ! [ -e index.php -a -e wp-includes/version.php ]; then
echo >&2 "WordPress not found in $PWD - copying now..."
if [ "$(ls -A)" ]; then
echo >&2 "WARNING: $PWD is not empty - press Ctrl+C now if this is an error!"
( set -x; ls -A; sleep 10 )
fi
tar cf - --one-file-system -C /usr/src/wordpress . | tar xf -
tar --create \
--file - \
--one-file-system \
--directory /usr/src/wordpress \
--owner "$user" --group "$group" \
. | tar --extract --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 All @@ -46,7 +67,7 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
</IfModule>
# END WordPress
EOF
chown www-data:www-data .htaccess
chown "$user:$group" .htaccess
fi
fi

Expand Down Expand Up @@ -115,7 +136,7 @@ if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROT
}

EOPHP
chown www-data:www-data wp-config.php
chown "$user:$group" wp-config.php
fi

# see http://stackoverflow.com/a/2705678/433558
Expand Down
27 changes: 24 additions & 3 deletions php5.6/fpm-alpine/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,34 @@ file_env() {
}

if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
if [ "$(id -u)" = '0' ]; then
case "$1" in
apache2*)
user="${APACHE_RUN_USER:-www-data}"
group="${APACHE_RUN_GROUP:-www-data}"
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$(id -u)"
group="$(id -g)"
fi

if ! [ -e index.php -a -e wp-includes/version.php ]; then
echo >&2 "WordPress not found in $PWD - copying now..."
if [ "$(ls -A)" ]; then
echo >&2 "WARNING: $PWD is not empty - press Ctrl+C now if this is an error!"
( set -x; ls -A; sleep 10 )
fi
tar cf - --one-file-system -C /usr/src/wordpress . | tar xf -
tar --create \
--file - \
--one-file-system \
--directory /usr/src/wordpress \
--owner "$user" --group "$group" \
. | tar --extract --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 All @@ -46,7 +67,7 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
</IfModule>
# END WordPress
EOF
chown www-data:www-data .htaccess
chown "$user:$group" .htaccess
fi
fi

Expand Down Expand Up @@ -115,7 +136,7 @@ if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROT
}

EOPHP
chown www-data:www-data wp-config.php
chown "$user:$group" wp-config.php
fi

# see http://stackoverflow.com/a/2705678/433558
Expand Down
27 changes: 24 additions & 3 deletions php5.6/fpm/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,34 @@ file_env() {
}

if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
if [ "$(id -u)" = '0' ]; then
case "$1" in
apache2*)
user="${APACHE_RUN_USER:-www-data}"
group="${APACHE_RUN_GROUP:-www-data}"
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$(id -u)"
group="$(id -g)"
fi

if ! [ -e index.php -a -e wp-includes/version.php ]; then
echo >&2 "WordPress not found in $PWD - copying now..."
if [ "$(ls -A)" ]; then
echo >&2 "WARNING: $PWD is not empty - press Ctrl+C now if this is an error!"
( set -x; ls -A; sleep 10 )
fi
tar cf - --one-file-system -C /usr/src/wordpress . | tar xf -
tar --create \
--file - \
--one-file-system \
--directory /usr/src/wordpress \
--owner "$user" --group "$group" \
. | tar --extract --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 All @@ -46,7 +67,7 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
</IfModule>
# END WordPress
EOF
chown www-data:www-data .htaccess
chown "$user:$group" .htaccess
fi
fi

Expand Down Expand Up @@ -115,7 +136,7 @@ if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROT
}

EOPHP
chown www-data:www-data wp-config.php
chown "$user:$group" wp-config.php
fi

# see http://stackoverflow.com/a/2705678/433558
Expand Down
27 changes: 24 additions & 3 deletions php7.0/apache/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,34 @@ file_env() {
}

if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
if [ "$(id -u)" = '0' ]; then
case "$1" in
apache2*)
user="${APACHE_RUN_USER:-www-data}"
group="${APACHE_RUN_GROUP:-www-data}"
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$(id -u)"
group="$(id -g)"
fi

if ! [ -e index.php -a -e wp-includes/version.php ]; then
echo >&2 "WordPress not found in $PWD - copying now..."
if [ "$(ls -A)" ]; then
echo >&2 "WARNING: $PWD is not empty - press Ctrl+C now if this is an error!"
( set -x; ls -A; sleep 10 )
fi
tar cf - --one-file-system -C /usr/src/wordpress . | tar xf -
tar --create \
--file - \
--one-file-system \
--directory /usr/src/wordpress \
--owner "$user" --group "$group" \
. | tar --extract --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 All @@ -46,7 +67,7 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
</IfModule>
# END WordPress
EOF
chown www-data:www-data .htaccess
chown "$user:$group" .htaccess
fi
fi

Expand Down Expand Up @@ -115,7 +136,7 @@ if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROT
}

EOPHP
chown www-data:www-data wp-config.php
chown "$user:$group" wp-config.php
fi

# see http://stackoverflow.com/a/2705678/433558
Expand Down
27 changes: 24 additions & 3 deletions php7.0/fpm-alpine/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,34 @@ file_env() {
}

if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
if [ "$(id -u)" = '0' ]; then
case "$1" in
apache2*)
user="${APACHE_RUN_USER:-www-data}"
group="${APACHE_RUN_GROUP:-www-data}"
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$(id -u)"
group="$(id -g)"
fi

if ! [ -e index.php -a -e wp-includes/version.php ]; then
echo >&2 "WordPress not found in $PWD - copying now..."
if [ "$(ls -A)" ]; then
echo >&2 "WARNING: $PWD is not empty - press Ctrl+C now if this is an error!"
( set -x; ls -A; sleep 10 )
fi
tar cf - --one-file-system -C /usr/src/wordpress . | tar xf -
tar --create \
--file - \
--one-file-system \
--directory /usr/src/wordpress \
--owner "$user" --group "$group" \
. | tar --extract --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 All @@ -46,7 +67,7 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
</IfModule>
# END WordPress
EOF
chown www-data:www-data .htaccess
chown "$user:$group" .htaccess
fi
fi

Expand Down Expand Up @@ -115,7 +136,7 @@ if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROT
}

EOPHP
chown www-data:www-data wp-config.php
chown "$user:$group" wp-config.php
fi

# see http://stackoverflow.com/a/2705678/433558
Expand Down
27 changes: 24 additions & 3 deletions php7.0/fpm/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,34 @@ file_env() {
}

if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
if [ "$(id -u)" = '0' ]; then
case "$1" in
apache2*)
user="${APACHE_RUN_USER:-www-data}"
group="${APACHE_RUN_GROUP:-www-data}"
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$(id -u)"
group="$(id -g)"
fi

if ! [ -e index.php -a -e wp-includes/version.php ]; then
echo >&2 "WordPress not found in $PWD - copying now..."
if [ "$(ls -A)" ]; then
echo >&2 "WARNING: $PWD is not empty - press Ctrl+C now if this is an error!"
( set -x; ls -A; sleep 10 )
fi
tar cf - --one-file-system -C /usr/src/wordpress . | tar xf -
tar --create \
--file - \
--one-file-system \
--directory /usr/src/wordpress \
--owner "$user" --group "$group" \
. | tar --extract --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 All @@ -46,7 +67,7 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
</IfModule>
# END WordPress
EOF
chown www-data:www-data .htaccess
chown "$user:$group" .htaccess
fi
fi

Expand Down Expand Up @@ -115,7 +136,7 @@ if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROT
}

EOPHP
chown www-data:www-data wp-config.php
chown "$user:$group" wp-config.php
fi

# see http://stackoverflow.com/a/2705678/433558
Expand Down
Loading