Merge pull request #22 from aspettl/php-ini

Fix: Recommended PHP settings not in .htaccess anymore
This commit is contained in:
Thomas B 2018-07-21 16:06:57 +02:00 committed by GitHub
commit 2497b3292d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 30 additions and 4 deletions

View File

@ -48,6 +48,9 @@ RUN set -ex; \
# enable mod_rewrite # enable mod_rewrite
RUN a2enmod rewrite RUN a2enmod rewrite
# use custom PHP settings
COPY php.ini /usr/local/etc/php/conf.d/roundcube-defaults.ini
# expose these volumes # expose these volumes
VOLUME /var/roundcube/config VOLUME /var/roundcube/config
VOLUME /tmp/roundcube-temp VOLUME /tmp/roundcube-temp

View File

@ -11,7 +11,6 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
( set -x; ls -A; sleep 10 ) ( set -x; ls -A; sleep 10 )
fi fi
tar cf - --one-file-system -C /usr/src/roundcubemail . | tar xf - tar cf - --one-file-system -C /usr/src/roundcubemail . | tar xf -
sed -i 's/mod_php5.c/mod_php7.c/' .htaccess
echo >&2 "Complete! ROUNDCUBEMAIL has been successfully copied to $PWD" echo >&2 "Complete! ROUNDCUBEMAIL has been successfully copied to $PWD"
fi fi
@ -86,7 +85,8 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
fi fi
if [ ! -z "${ROUNDCUBEMAIL_UPLOAD_MAX_FILESIZE}" ]; then if [ ! -z "${ROUNDCUBEMAIL_UPLOAD_MAX_FILESIZE}" ]; then
sed -i -E "s/(upload_max_filesize|post_max_size) +[0-9BKMG]+/\1 ${ROUNDCUBEMAIL_UPLOAD_MAX_FILESIZE}/g" $PWD/.htaccess echo "upload_max_filesize=${ROUNDCUBEMAIL_UPLOAD_MAX_FILESIZE}" >> /usr/local/etc/php/conf.d/roundcube-override.ini
echo "post_max_size=${ROUNDCUBEMAIL_UPLOAD_MAX_FILESIZE}" >> /usr/local/etc/php/conf.d/roundcube-override.ini
fi fi
fi fi

10
php-apache/php.ini Normal file
View File

@ -0,0 +1,10 @@
memory_limit=64M
display_errors=Off
log_errors=On
upload_max_filesize=5M
post_max_size=6M
zlib.output_compression=Off
session.auto_start=Off
session.gc_maxlifetime=21600
session.gc_divisor=500
session.gc_probability=1

View File

@ -45,6 +45,9 @@ RUN set -ex; \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
# use custom PHP settings
COPY php.ini /usr/local/etc/php/conf.d/roundcube-defaults.ini
# expose these volumes # expose these volumes
VOLUME /var/roundcube/config VOLUME /var/roundcube/config
VOLUME /var/www/html VOLUME /var/www/html

View File

@ -11,7 +11,6 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
( set -x; ls -A; sleep 10 ) ( set -x; ls -A; sleep 10 )
fi fi
tar cf - --one-file-system -C /usr/src/roundcubemail . | tar xf - tar cf - --one-file-system -C /usr/src/roundcubemail . | tar xf -
sed -i 's/mod_php5.c/mod_php7.c/' .htaccess
echo >&2 "Complete! ROUNDCUBEMAIL has been successfully copied to $PWD" echo >&2 "Complete! ROUNDCUBEMAIL has been successfully copied to $PWD"
fi fi
@ -86,7 +85,8 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
fi fi
if [ ! -z "${ROUNDCUBEMAIL_UPLOAD_MAX_FILESIZE}" ]; then if [ ! -z "${ROUNDCUBEMAIL_UPLOAD_MAX_FILESIZE}" ]; then
sed -i -E "s/(upload_max_filesize|post_max_size) +[0-9BKMG]+/\1 ${ROUNDCUBEMAIL_UPLOAD_MAX_FILESIZE}/g" $PWD/.htaccess echo "upload_max_filesize=${ROUNDCUBEMAIL_UPLOAD_MAX_FILESIZE}" >> /usr/local/etc/php/conf.d/roundcube-override.ini
echo "post_max_size=${ROUNDCUBEMAIL_UPLOAD_MAX_FILESIZE}" >> /usr/local/etc/php/conf.d/roundcube-override.ini
fi fi
fi fi

10
php-fpm/php.ini Normal file
View File

@ -0,0 +1,10 @@
memory_limit=64M
display_errors=Off
log_errors=On
upload_max_filesize=5M
post_max_size=6M
zlib.output_compression=Off
session.auto_start=Off
session.gc_maxlifetime=21600
session.gc_divisor=500
session.gc_probability=1