diff --git a/glpi/docker-entrypoint.sh b/glpi/docker-entrypoint.sh new file mode 100644 index 0000000..6646dce --- /dev/null +++ b/glpi/docker-entrypoint.sh @@ -0,0 +1,25 @@ +#!/bin/bash +set -e + +# Applique la timezone système et PHP si définie +if [ -n "$TZ" ]; then + echo "Configuration du timezone système et PHP : $TZ" + ln -snf /usr/share/zoneinfo/$TZ /etc/localtime + echo "$TZ" > /etc/timezone + + # Met à jour la timezone PHP-FPM + if grep -q "^date.timezone" /etc/php.ini; then + sed -i "s|^date.timezone =.*|date.timezone = $TZ|" /etc/php.ini + else + echo "date.timezone = $TZ" >> /etc/php.ini + fi +fi + + +# Injecte GLPI_FQDN dans le vhost +GLPI_FQDN="${GLPI_FQDN:-localhost}" +envsubst '${GLPI_FQDN}' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf +echo 'php_value[session.save_path] = /var/www/html/files/_sessions' >> /etc/php-fpm.d/www.conf + +# Lancer supervisord (gère nginx + php-fpm) +exec /usr/bin/supervisord -c /etc/supervisord.conf \ No newline at end of file