Infra_docker/glpi/docker-entrypoint.sh

25 lines
No EOL
806 B
Bash

#!/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