2
0
Fork 0
mirror of https://github.com/friendica/docker synced 2024-06-20 07:09:26 +02:00

Merge branch 'friendica:stable' into stable

This commit is contained in:
Chad Walter Cummings 2022-02-17 19:04:54 -06:00 committed by GitHub
commit 37ce0ed68e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 99 additions and 99 deletions

View file

@ -95,7 +95,7 @@ RUN set -ex; \
# pecl will claim success even if one install fails, so we need to perform each install separately # pecl will claim success even if one install fails, so we need to perform each install separately
pecl install apcu-5.1.21; \ pecl install apcu-5.1.21; \
pecl install memcached-3.1.5; \ pecl install memcached-3.1.5; \
pecl install redis-5.3.6; \ pecl install redis-5.3.7; \
pecl install imagick-3.7.0; \ pecl install imagick-3.7.0; \
\ \
docker-php-ext-enable \ docker-php-ext-enable \

View file

@ -3,11 +3,11 @@ set -eu
# run an command with the www-data user # run an command with the www-data user
run_as() { run_as() {
set -- sh -c "cd /var/www/html; $*"
if [ "$(id -u)" -eq 0 ]; then if [ "$(id -u)" -eq 0 ]; then
su -p www-data -s /bin/sh -c "$1" set -- gosu www-data "$@"
else
sh -c "$1"
fi fi
"$@"
} }
# checks if the the first parameter is greater than the second parameter # checks if the the first parameter is greater than the second parameter
@ -20,11 +20,11 @@ version_greater() {
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of # (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
# "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature) # "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature)
file_env() { file_env() {
local var="$1" var="$1"
local fileVar="${var}_FILE" fileVar="${var}_FILE"
local def="${2:-}" def="${2:-}"
local varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//") varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//")
local fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//") fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//")
if [ -n "${varValue}" ] && [ -n "${fileVarValue}" ]; then if [ -n "${varValue}" ] && [ -n "${fileVarValue}" ]; then
echo >&2 "error: both $var and $fileVar are set (but are exclusive)" echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
exit 1 exit 1
@ -49,7 +49,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
file_env REDIS_PW file_env REDIS_PW
echo 'session.save_handler = redis' echo 'session.save_handler = redis'
# check if redis host is an unix socket path # check if redis host is an unix socket path
if [ "${REDIS_HOST:0:1}" = "/" ]; then if expr "${REDIS_HOST}" : "/" 1>/dev/null; then
if [ -n "${REDIS_PW+x}" ]; then if [ -n "${REDIS_PW+x}" ]; then
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_PW}\"" echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_PW}\""
else else

View file

@ -81,7 +81,7 @@ RUN set -ex; \
# pecl will claim success even if one install fails, so we need to perform each install separately # pecl will claim success even if one install fails, so we need to perform each install separately
pecl install APCu-5.1.21; \ pecl install APCu-5.1.21; \
pecl install memcached-3.1.5; \ pecl install memcached-3.1.5; \
pecl install redis-5.3.6; \ pecl install redis-5.3.7; \
pecl install imagick-3.7.0; \ pecl install imagick-3.7.0; \
\ \
docker-php-ext-enable \ docker-php-ext-enable \

View file

@ -3,11 +3,11 @@ set -eu
# run an command with the www-data user # run an command with the www-data user
run_as() { run_as() {
set -- sh -c "cd /var/www/html; $*"
if [ "$(id -u)" -eq 0 ]; then if [ "$(id -u)" -eq 0 ]; then
su -p www-data -s /bin/sh -c "$1" set -- gosu www-data "$@"
else
sh -c "$1"
fi fi
"$@"
} }
# checks if the the first parameter is greater than the second parameter # checks if the the first parameter is greater than the second parameter
@ -20,11 +20,11 @@ version_greater() {
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of # (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
# "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature) # "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature)
file_env() { file_env() {
local var="$1" var="$1"
local fileVar="${var}_FILE" fileVar="${var}_FILE"
local def="${2:-}" def="${2:-}"
local varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//") varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//")
local fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//") fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//")
if [ -n "${varValue}" ] && [ -n "${fileVarValue}" ]; then if [ -n "${varValue}" ] && [ -n "${fileVarValue}" ]; then
echo >&2 "error: both $var and $fileVar are set (but are exclusive)" echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
exit 1 exit 1
@ -49,7 +49,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
file_env REDIS_PW file_env REDIS_PW
echo 'session.save_handler = redis' echo 'session.save_handler = redis'
# check if redis host is an unix socket path # check if redis host is an unix socket path
if [ "${REDIS_HOST:0:1}" = "/" ]; then if expr "${REDIS_HOST}" : "/" 1>/dev/null; then
if [ -n "${REDIS_PW+x}" ]; then if [ -n "${REDIS_PW+x}" ]; then
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_PW}\"" echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_PW}\""
else else

View file

@ -95,7 +95,7 @@ RUN set -ex; \
# pecl will claim success even if one install fails, so we need to perform each install separately # pecl will claim success even if one install fails, so we need to perform each install separately
pecl install apcu-5.1.21; \ pecl install apcu-5.1.21; \
pecl install memcached-3.1.5; \ pecl install memcached-3.1.5; \
pecl install redis-5.3.6; \ pecl install redis-5.3.7; \
pecl install imagick-3.7.0; \ pecl install imagick-3.7.0; \
\ \
docker-php-ext-enable \ docker-php-ext-enable \

View file

@ -3,11 +3,11 @@ set -eu
# run an command with the www-data user # run an command with the www-data user
run_as() { run_as() {
set -- sh -c "cd /var/www/html; $*"
if [ "$(id -u)" -eq 0 ]; then if [ "$(id -u)" -eq 0 ]; then
su -p www-data -s /bin/sh -c "$1" set -- gosu www-data "$@"
else
sh -c "$1"
fi fi
"$@"
} }
# checks if the the first parameter is greater than the second parameter # checks if the the first parameter is greater than the second parameter
@ -20,11 +20,11 @@ version_greater() {
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of # (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
# "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature) # "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature)
file_env() { file_env() {
local var="$1" var="$1"
local fileVar="${var}_FILE" fileVar="${var}_FILE"
local def="${2:-}" def="${2:-}"
local varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//") varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//")
local fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//") fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//")
if [ -n "${varValue}" ] && [ -n "${fileVarValue}" ]; then if [ -n "${varValue}" ] && [ -n "${fileVarValue}" ]; then
echo >&2 "error: both $var and $fileVar are set (but are exclusive)" echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
exit 1 exit 1
@ -49,7 +49,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
file_env REDIS_PW file_env REDIS_PW
echo 'session.save_handler = redis' echo 'session.save_handler = redis'
# check if redis host is an unix socket path # check if redis host is an unix socket path
if [ "${REDIS_HOST:0:1}" = "/" ]; then if expr "${REDIS_HOST}" : "/" 1>/dev/null; then
if [ -n "${REDIS_PW+x}" ]; then if [ -n "${REDIS_PW+x}" ]; then
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_PW}\"" echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_PW}\""
else else

View file

@ -95,7 +95,7 @@ RUN set -ex; \
# pecl will claim success even if one install fails, so we need to perform each install separately # pecl will claim success even if one install fails, so we need to perform each install separately
pecl install apcu-5.1.21; \ pecl install apcu-5.1.21; \
pecl install memcached-3.1.5; \ pecl install memcached-3.1.5; \
pecl install redis-5.3.6; \ pecl install redis-5.3.7; \
pecl install imagick-3.7.0; \ pecl install imagick-3.7.0; \
\ \
docker-php-ext-enable \ docker-php-ext-enable \

View file

@ -3,11 +3,11 @@ set -eu
# run an command with the www-data user # run an command with the www-data user
run_as() { run_as() {
set -- sh -c "cd /var/www/html; $*"
if [ "$(id -u)" -eq 0 ]; then if [ "$(id -u)" -eq 0 ]; then
su -p www-data -s /bin/sh -c "$1" set -- gosu www-data "$@"
else
sh -c "$1"
fi fi
"$@"
} }
# checks if the the first parameter is greater than the second parameter # checks if the the first parameter is greater than the second parameter
@ -20,11 +20,11 @@ version_greater() {
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of # (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
# "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature) # "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature)
file_env() { file_env() {
local var="$1" var="$1"
local fileVar="${var}_FILE" fileVar="${var}_FILE"
local def="${2:-}" def="${2:-}"
local varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//") varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//")
local fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//") fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//")
if [ -n "${varValue}" ] && [ -n "${fileVarValue}" ]; then if [ -n "${varValue}" ] && [ -n "${fileVarValue}" ]; then
echo >&2 "error: both $var and $fileVar are set (but are exclusive)" echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
exit 1 exit 1
@ -49,7 +49,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
file_env REDIS_PW file_env REDIS_PW
echo 'session.save_handler = redis' echo 'session.save_handler = redis'
# check if redis host is an unix socket path # check if redis host is an unix socket path
if [ "${REDIS_HOST:0:1}" = "/" ]; then if expr "${REDIS_HOST}" : "/" 1>/dev/null; then
if [ -n "${REDIS_PW+x}" ]; then if [ -n "${REDIS_PW+x}" ]; then
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_PW}\"" echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_PW}\""
else else

View file

@ -81,7 +81,7 @@ RUN set -ex; \
# pecl will claim success even if one install fails, so we need to perform each install separately # pecl will claim success even if one install fails, so we need to perform each install separately
pecl install APCu-5.1.21; \ pecl install APCu-5.1.21; \
pecl install memcached-3.1.5; \ pecl install memcached-3.1.5; \
pecl install redis-5.3.6; \ pecl install redis-5.3.7; \
pecl install imagick-3.7.0; \ pecl install imagick-3.7.0; \
\ \
docker-php-ext-enable \ docker-php-ext-enable \

View file

@ -3,11 +3,11 @@ set -eu
# run an command with the www-data user # run an command with the www-data user
run_as() { run_as() {
set -- sh -c "cd /var/www/html; $*"
if [ "$(id -u)" -eq 0 ]; then if [ "$(id -u)" -eq 0 ]; then
su -p www-data -s /bin/sh -c "$1" set -- gosu www-data "$@"
else
sh -c "$1"
fi fi
"$@"
} }
# checks if the the first parameter is greater than the second parameter # checks if the the first parameter is greater than the second parameter
@ -20,11 +20,11 @@ version_greater() {
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of # (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
# "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature) # "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature)
file_env() { file_env() {
local var="$1" var="$1"
local fileVar="${var}_FILE" fileVar="${var}_FILE"
local def="${2:-}" def="${2:-}"
local varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//") varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//")
local fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//") fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//")
if [ -n "${varValue}" ] && [ -n "${fileVarValue}" ]; then if [ -n "${varValue}" ] && [ -n "${fileVarValue}" ]; then
echo >&2 "error: both $var and $fileVar are set (but are exclusive)" echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
exit 1 exit 1
@ -49,7 +49,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
file_env REDIS_PW file_env REDIS_PW
echo 'session.save_handler = redis' echo 'session.save_handler = redis'
# check if redis host is an unix socket path # check if redis host is an unix socket path
if [ "${REDIS_HOST:0:1}" = "/" ]; then if expr "${REDIS_HOST}" : "/" 1>/dev/null; then
if [ -n "${REDIS_PW+x}" ]; then if [ -n "${REDIS_PW+x}" ]; then
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_PW}\"" echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_PW}\""
else else

View file

@ -95,7 +95,7 @@ RUN set -ex; \
# pecl will claim success even if one install fails, so we need to perform each install separately # pecl will claim success even if one install fails, so we need to perform each install separately
pecl install apcu-5.1.21; \ pecl install apcu-5.1.21; \
pecl install memcached-3.1.5; \ pecl install memcached-3.1.5; \
pecl install redis-5.3.6; \ pecl install redis-5.3.7; \
pecl install imagick-3.7.0; \ pecl install imagick-3.7.0; \
\ \
docker-php-ext-enable \ docker-php-ext-enable \

View file

@ -3,11 +3,11 @@ set -eu
# run an command with the www-data user # run an command with the www-data user
run_as() { run_as() {
set -- sh -c "cd /var/www/html; $*"
if [ "$(id -u)" -eq 0 ]; then if [ "$(id -u)" -eq 0 ]; then
su -p www-data -s /bin/sh -c "$1" set -- gosu www-data "$@"
else
sh -c "$1"
fi fi
"$@"
} }
# checks if the the first parameter is greater than the second parameter # checks if the the first parameter is greater than the second parameter
@ -20,11 +20,11 @@ version_greater() {
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of # (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
# "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature) # "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature)
file_env() { file_env() {
local var="$1" var="$1"
local fileVar="${var}_FILE" fileVar="${var}_FILE"
local def="${2:-}" def="${2:-}"
local varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//") varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//")
local fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//") fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//")
if [ -n "${varValue}" ] && [ -n "${fileVarValue}" ]; then if [ -n "${varValue}" ] && [ -n "${fileVarValue}" ]; then
echo >&2 "error: both $var and $fileVar are set (but are exclusive)" echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
exit 1 exit 1
@ -49,7 +49,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
file_env REDIS_PW file_env REDIS_PW
echo 'session.save_handler = redis' echo 'session.save_handler = redis'
# check if redis host is an unix socket path # check if redis host is an unix socket path
if [ "${REDIS_HOST:0:1}" = "/" ]; then if expr "${REDIS_HOST}" : "/" 1>/dev/null; then
if [ -n "${REDIS_PW+x}" ]; then if [ -n "${REDIS_PW+x}" ]; then
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_PW}\"" echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_PW}\""
else else

View file

@ -95,7 +95,7 @@ RUN set -ex; \
# pecl will claim success even if one install fails, so we need to perform each install separately # pecl will claim success even if one install fails, so we need to perform each install separately
pecl install apcu-5.1.21; \ pecl install apcu-5.1.21; \
pecl install memcached-3.1.5; \ pecl install memcached-3.1.5; \
pecl install redis-5.3.6; \ pecl install redis-5.3.7; \
pecl install imagick-3.7.0; \ pecl install imagick-3.7.0; \
\ \
docker-php-ext-enable \ docker-php-ext-enable \

View file

@ -3,11 +3,11 @@ set -eu
# run an command with the www-data user # run an command with the www-data user
run_as() { run_as() {
set -- sh -c "cd /var/www/html; $*"
if [ "$(id -u)" -eq 0 ]; then if [ "$(id -u)" -eq 0 ]; then
su -p www-data -s /bin/sh -c "$1" set -- gosu www-data "$@"
else
sh -c "$1"
fi fi
"$@"
} }
# checks if the the first parameter is greater than the second parameter # checks if the the first parameter is greater than the second parameter
@ -20,11 +20,11 @@ version_greater() {
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of # (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
# "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature) # "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature)
file_env() { file_env() {
local var="$1" var="$1"
local fileVar="${var}_FILE" fileVar="${var}_FILE"
local def="${2:-}" def="${2:-}"
local varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//") varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//")
local fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//") fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//")
if [ -n "${varValue}" ] && [ -n "${fileVarValue}" ]; then if [ -n "${varValue}" ] && [ -n "${fileVarValue}" ]; then
echo >&2 "error: both $var and $fileVar are set (but are exclusive)" echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
exit 1 exit 1
@ -49,7 +49,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
file_env REDIS_PW file_env REDIS_PW
echo 'session.save_handler = redis' echo 'session.save_handler = redis'
# check if redis host is an unix socket path # check if redis host is an unix socket path
if [ "${REDIS_HOST:0:1}" = "/" ]; then if expr "${REDIS_HOST}" : "/" 1>/dev/null; then
if [ -n "${REDIS_PW+x}" ]; then if [ -n "${REDIS_PW+x}" ]; then
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_PW}\"" echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_PW}\""
else else

View file

@ -81,7 +81,7 @@ RUN set -ex; \
# pecl will claim success even if one install fails, so we need to perform each install separately # pecl will claim success even if one install fails, so we need to perform each install separately
pecl install APCu-5.1.21; \ pecl install APCu-5.1.21; \
pecl install memcached-3.1.5; \ pecl install memcached-3.1.5; \
pecl install redis-5.3.6; \ pecl install redis-5.3.7; \
pecl install imagick-3.7.0; \ pecl install imagick-3.7.0; \
\ \
docker-php-ext-enable \ docker-php-ext-enable \

View file

@ -3,11 +3,11 @@ set -eu
# run an command with the www-data user # run an command with the www-data user
run_as() { run_as() {
set -- sh -c "cd /var/www/html; $*"
if [ "$(id -u)" -eq 0 ]; then if [ "$(id -u)" -eq 0 ]; then
su -p www-data -s /bin/sh -c "$1" set -- gosu www-data "$@"
else
sh -c "$1"
fi fi
"$@"
} }
# checks if the the first parameter is greater than the second parameter # checks if the the first parameter is greater than the second parameter
@ -20,11 +20,11 @@ version_greater() {
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of # (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
# "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature) # "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature)
file_env() { file_env() {
local var="$1" var="$1"
local fileVar="${var}_FILE" fileVar="${var}_FILE"
local def="${2:-}" def="${2:-}"
local varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//") varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//")
local fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//") fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//")
if [ -n "${varValue}" ] && [ -n "${fileVarValue}" ]; then if [ -n "${varValue}" ] && [ -n "${fileVarValue}" ]; then
echo >&2 "error: both $var and $fileVar are set (but are exclusive)" echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
exit 1 exit 1
@ -49,7 +49,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
file_env REDIS_PW file_env REDIS_PW
echo 'session.save_handler = redis' echo 'session.save_handler = redis'
# check if redis host is an unix socket path # check if redis host is an unix socket path
if [ "${REDIS_HOST:0:1}" = "/" ]; then if expr "${REDIS_HOST}" : "/" 1>/dev/null; then
if [ -n "${REDIS_PW+x}" ]; then if [ -n "${REDIS_PW+x}" ]; then
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_PW}\"" echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_PW}\""
else else

View file

@ -95,7 +95,7 @@ RUN set -ex; \
# pecl will claim success even if one install fails, so we need to perform each install separately # pecl will claim success even if one install fails, so we need to perform each install separately
pecl install apcu-5.1.21; \ pecl install apcu-5.1.21; \
pecl install memcached-3.1.5; \ pecl install memcached-3.1.5; \
pecl install redis-5.3.6; \ pecl install redis-5.3.7; \
pecl install imagick-3.7.0; \ pecl install imagick-3.7.0; \
\ \
docker-php-ext-enable \ docker-php-ext-enable \

View file

@ -3,11 +3,11 @@ set -eu
# run an command with the www-data user # run an command with the www-data user
run_as() { run_as() {
set -- sh -c "cd /var/www/html; $*"
if [ "$(id -u)" -eq 0 ]; then if [ "$(id -u)" -eq 0 ]; then
su -p www-data -s /bin/sh -c "$1" set -- gosu www-data "$@"
else
sh -c "$1"
fi fi
"$@"
} }
# checks if the the first parameter is greater than the second parameter # checks if the the first parameter is greater than the second parameter
@ -20,11 +20,11 @@ version_greater() {
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of # (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
# "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature) # "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature)
file_env() { file_env() {
local var="$1" var="$1"
local fileVar="${var}_FILE" fileVar="${var}_FILE"
local def="${2:-}" def="${2:-}"
local varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//") varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//")
local fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//") fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//")
if [ -n "${varValue}" ] && [ -n "${fileVarValue}" ]; then if [ -n "${varValue}" ] && [ -n "${fileVarValue}" ]; then
echo >&2 "error: both $var and $fileVar are set (but are exclusive)" echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
exit 1 exit 1
@ -49,7 +49,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
file_env REDIS_PW file_env REDIS_PW
echo 'session.save_handler = redis' echo 'session.save_handler = redis'
# check if redis host is an unix socket path # check if redis host is an unix socket path
if [ "${REDIS_HOST:0:1}" = "/" ]; then if expr "${REDIS_HOST}" : "/" 1>/dev/null; then
if [ -n "${REDIS_PW+x}" ]; then if [ -n "${REDIS_PW+x}" ]; then
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_PW}\"" echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_PW}\""
else else

View file

@ -3,11 +3,11 @@ set -eu
# run an command with the www-data user # run an command with the www-data user
run_as() { run_as() {
set -- sh -c "cd /var/www/html; $*"
if [ "$(id -u)" -eq 0 ]; then if [ "$(id -u)" -eq 0 ]; then
su -p www-data -s /bin/sh -c "$1" set -- gosu www-data "$@"
else
sh -c "$1"
fi fi
"$@"
} }
# checks if the the first parameter is greater than the second parameter # checks if the the first parameter is greater than the second parameter
@ -20,11 +20,11 @@ version_greater() {
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of # (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
# "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature) # "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature)
file_env() { file_env() {
local var="$1" var="$1"
local fileVar="${var}_FILE" fileVar="${var}_FILE"
local def="${2:-}" def="${2:-}"
local varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//") varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//")
local fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//") fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//")
if [ -n "${varValue}" ] && [ -n "${fileVarValue}" ]; then if [ -n "${varValue}" ] && [ -n "${fileVarValue}" ]; then
echo >&2 "error: both $var and $fileVar are set (but are exclusive)" echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
exit 1 exit 1
@ -49,7 +49,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
file_env REDIS_PW file_env REDIS_PW
echo 'session.save_handler = redis' echo 'session.save_handler = redis'
# check if redis host is an unix socket path # check if redis host is an unix socket path
if [ "${REDIS_HOST:0:1}" = "/" ]; then if expr "${REDIS_HOST}" : "/" 1>/dev/null; then
if [ -n "${REDIS_PW+x}" ]; then if [ -n "${REDIS_PW+x}" ]; then
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_PW}\"" echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_PW}\""
else else