ldc-web-images-docker/PHP8.5/DEV/conf/docker-entrypoint.sh
2026-09-23 16:26:45 +02:00

20 lines
No EOL
484 B
Bash

#!/bin/sh
set -e
# Démarrer php-fpm en arrière-plan (flag -D = --daemonize).
php-fpm -D
# Attendre que php-fpm soit prêt (max 10s, échec si timeout).
for i in $(seq 1 10); do
if pgrep -f "php-fpm" > /dev/null 2>&1; then
break
fi
if [ "$i" -eq 10 ]; then
echo "ERROR: php-fpm failed to start within 10 seconds" >&2
exit 1
fi
sleep 1
done
# Démarrer apache au premier plan (flag -D = -Define <variable_name>).
exec httpd -D FOREGROUND