Use php.ini for PHP default settings, override for max upload file size
authorAaron Spettl <redacted>
Sat, 23 Jun 2018 09:52:28 +0000 (11:52 +0200)
committerAaron Spettl <redacted>
Sat, 23 Jun 2018 09:52:28 +0000 (11:52 +0200)
php-apache/Dockerfile
php-apache/docker-entrypoint.sh
php-fpm/Dockerfile
php-fpm/docker-entrypoint.sh

index 0bc8cd55ba258421a17d644dc5259219a8e51d2b..621c8b02a7ffe926a7663b45975c07657d59c4ca 100644 (file)
@@ -48,6 +48,9 @@ RUN set -ex; \
 # enable mod_rewrite
 RUN a2enmod rewrite
 
+# use custom PHP settings
+COPY php.ini /usr/local/etc/php/conf.d/roundcube-defaults.ini
+
 # expose these volumes
 VOLUME /var/roundcube/config
 VOLUME /tmp/roundcube-temp
index 294bb440386cd59f4a1539d69de006fe546817bb..3b7db5c49bd08a7927727ed3603b205f90f327ff 100755 (executable)
@@ -11,7 +11,6 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
       ( set -x; ls -A; sleep 10 )
     fi
     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"
   fi
 
@@ -86,7 +85,8 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
   fi
 
   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
 
index c25be08fe8e1d9a35bc466aa67c99048d3181560..85a77d2fd8586962600de2836acd99f1039f2bf3 100644 (file)
@@ -45,6 +45,9 @@ RUN set -ex; \
        apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
        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
 VOLUME /var/roundcube/config
 VOLUME /var/www/html
index 2ec37662dcc56cf2264221e70b73c2b5ec421613..c253fc8d2432e1022c5bc53984ad0185761e84de 100755 (executable)
@@ -11,7 +11,6 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
       ( set -x; ls -A; sleep 10 )
     fi
     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"
   fi
 
@@ -86,7 +85,8 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
   fi
 
   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
 
git clone https://git.99rst.org/PROJECT