Use php.ini for PHP default settings, override for max upload file size

This commit is contained in:
Aaron Spettl 2018-06-23 11:52:28 +02:00
parent 053aaa056c
commit 21460c4ed3
4 changed files with 10 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

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