From 8759a0ea455f35e321e0778c92f90f03e0b1a48a Mon Sep 17 00:00:00 2001 From: n-someya Date: Sat, 31 Jan 2026 16:00:19 +0900 Subject: [PATCH] Add netcat for Nginx bootstrap script to wait for php-fpm readiness and change php config files path to 8.4. --- Dockerfile | 1 + root/etc/{php81 => php84}/php-fpm.conf | 0 root/etc/{php81 => php84}/php.ini | 0 root/etc/s6/nginx/run | 8 ++++++++ 4 files changed, 9 insertions(+) rename root/etc/{php81 => php84}/php-fpm.conf (100%) rename root/etc/{php81 => php84}/php.ini (100%) diff --git a/Dockerfile b/Dockerfile index 9cb1010..b24aa98 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,6 +20,7 @@ RUN set -ex \ curl \ libwebp \ nginx \ + netcat-openbsd \ pcre \ php84 \ php84-bcmath \ diff --git a/root/etc/php81/php-fpm.conf b/root/etc/php84/php-fpm.conf similarity index 100% rename from root/etc/php81/php-fpm.conf rename to root/etc/php84/php-fpm.conf diff --git a/root/etc/php81/php.ini b/root/etc/php84/php.ini similarity index 100% rename from root/etc/php81/php.ini rename to root/etc/php84/php.ini diff --git a/root/etc/s6/nginx/run b/root/etc/s6/nginx/run index ad7c0a7..ec0d39a 100755 --- a/root/etc/s6/nginx/run +++ b/root/etc/s6/nginx/run @@ -1,3 +1,11 @@ #!/bin/sh +echo "Ready to start Nginx, waiting for php-fpm on 127.0.0.1:9000..." +# Wait for php-fpm to be ready +until nc -z 127.0.0.1 9000; do + echo "Wait for php-fpm..." + sleep 1 +done +echo "php-fpm is up! Starting nginx." + exec nginx -c /etc/nginx/nginx.conf