Browse Source

Fix update PHP config

TuxGasy 2 years ago
parent
commit
0cb2af4ecb
3 changed files with 7 additions and 5 deletions
  1. 1 1
      build/docker/README.md
  2. 2 0
      build/docker/docker-compose.yml
  3. 4 4
      build/docker/docker-run.sh

+ 1 - 1
build/docker/README.md

@@ -25,7 +25,7 @@ The URL to go to the Dolibarr is :
 The URL to go to PhpMyAdmin is (login/password is root/root) :
 The URL to go to PhpMyAdmin is (login/password is root/root) :
 
 
         http://0.0.0.0:8080
         http://0.0.0.0:8080
-        
+
 In Dolibarr configuration Email let PHP mail function, To see all mail send by Dolibarr go to maildev
 In Dolibarr configuration Email let PHP mail function, To see all mail send by Dolibarr go to maildev
 
 
         http://0.0.0.0:8081
         http://0.0.0.0:8081

+ 2 - 0
build/docker/docker-compose.yml

@@ -34,6 +34,8 @@ services:
         build: .
         build: .
         environment:
         environment:
             HOST_USER_ID: $HOST_USER_ID
             HOST_USER_ID: $HOST_USER_ID
+            PHP_INI_DATE_TIMEZONE: $PHP_INI_DATE_TIMEZONE
+            PHP_INI_MEMORY_LIMIT: $PHP_INI_MEMORY_LIMIT
         volumes:
         volumes:
             - ../../htdocs:/var/www/html/
             - ../../htdocs:/var/www/html/
             - ../../documents:/var/documents
             - ../../documents:/var/documents

+ 4 - 4
build/docker/docker-run.sh

@@ -15,10 +15,10 @@ fi
 echo "[docker-run] => Set Permission to www-data for /var/documents"
 echo "[docker-run] => Set Permission to www-data for /var/documents"
 chown -R www-data:www-data /var/documents
 chown -R www-data:www-data /var/documents
 
 
-if [ ! -f /usr/local/etc/php/php.ini ]; then
-  cat <<EOF > /usr/local/etc/php/php.ini
-date.timezone = $PHP_INI_DATE_TIMEZONE
+echo "[docker-run] => update ${PHP_INI_DIR}/conf.d/dolibarr-php.ini"
+cat <<EOF > ${PHP_INI_DIR}/conf.d/dolibarr-php.ini
+date.timezone = ${PHP_INI_DATE_TIMEZONE:-UTC}
+memory_limit = ${PHP_INI_MEMORY_LIMIT:-256M}
 EOF
 EOF
-fi
 
 
 exec apache2-foreground
 exec apache2-foreground