Ajouter glpi/docker-entrypoint.sh

This commit is contained in:
dimitri 2025-06-09 23:21:23 +02:00
parent 52e4ecf13b
commit f7239d85c9

25
glpi/docker-entrypoint.sh Normal file
View file

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