From f2a8d80f43b3be7988dcf88d948e15342e260dc2 Mon Sep 17 00:00:00 2001 From: Chris Fidao Date: Wed, 21 Feb 2024 10:13:47 -0500 Subject: [PATCH] small delay in starting nginx to ensure upstreams have started and can accept connections --- src/Dockerfile | 1 + src/start-nginx.sh | 3 +++ src/supervisor/conf.d/nginx.conf | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100755 src/start-nginx.sh diff --git a/src/Dockerfile b/src/Dockerfile index 9cef059..aebe081 100644 --- a/src/Dockerfile +++ b/src/Dockerfile @@ -41,6 +41,7 @@ COPY nginx/ /etc/nginx/ COPY fpm/ /etc/php/${PHP_VERSION}/fpm/ COPY supervisor/ /etc/supervisor/ COPY entrypoint.sh /entrypoint +COPY start-nginx.sh /usr/local/bin/start-nginx WORKDIR /var/www/html diff --git a/src/start-nginx.sh b/src/start-nginx.sh new file mode 100755 index 0000000..c4057e0 --- /dev/null +++ b/src/start-nginx.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +sleep 0.25 && exec nginx diff --git a/src/supervisor/conf.d/nginx.conf b/src/supervisor/conf.d/nginx.conf index 52fcae7..270aae9 100644 --- a/src/supervisor/conf.d/nginx.conf +++ b/src/supervisor/conf.d/nginx.conf @@ -4,7 +4,7 @@ autostart=true autorestart=true stdout_events_enabled=true stderr_events_enabled=true -command=nginx +command=/usr/local/bin/start-nginx stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr