Merge pull request #23575 from tuxgasy/update_docker_with_php8

Update docker with php8
This commit is contained in:
Laurent Destailleur 2023-01-17 18:20:30 +01:00 committed by GitHub
commit 06b048cb88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 7 deletions

View File

@ -1,4 +1,4 @@
FROM php:7.3-apache FROM php:8.1-apache-bullseye
ENV PHP_INI_DATE_TIMEZONE 'UTC' ENV PHP_INI_DATE_TIMEZONE 'UTC'
ENV PHP_INI_MEMORY_LIMIT 256M ENV PHP_INI_MEMORY_LIMIT 256M
@ -25,7 +25,7 @@ RUN apt-get update -y \
mailutils \ mailutils \
&& apt-get autoremove -y \ && apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \ && docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) calendar intl mysqli pdo_mysql gd soap zip \ && docker-php-ext-install -j$(nproc) calendar intl mysqli pdo_mysql gd soap zip \
&& docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \ && docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \
&& docker-php-ext-install -j$(nproc) ldap && \ && docker-php-ext-install -j$(nproc) ldap && \

View File

@ -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

View File

@ -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 echo "[docker-run] => update ${PHP_INI_DIR}/conf.d/dolibarr-php.ini"
cat <<EOF > /usr/local/etc/php/php.ini cat <<EOF > ${PHP_INI_DIR}/conf.d/dolibarr-php.ini
date.timezone = $PHP_INI_DATE_TIMEZONE date.timezone = ${PHP_INI_DATE_TIMEZONE:-UTC}
memory_limit = ${PHP_INI_MEMORY_LIMIT:-256M}
EOF EOF
fi
exec apache2-foreground exec apache2-foreground