diff --git a/docker/start.sh b/docker/start.sh index 5bd2356..9751857 100644 --- a/docker/start.sh +++ b/docker/start.sh @@ -26,8 +26,15 @@ sed -i "s/^post_max_size = .*/post_max_size = ${MAX_UPLOAD_SIZE}/" /etc/php/8.1/ # Set max upload size for nginx sed -i "s/client_max_body_size 500M;/client_max_body_size ${MAX_UPLOAD_SIZE};/" /etc/nginx/nginx.conf -# Start Nginx -echo "Starting PHP & Nginx" -/etc/init.d/php8.1-fpm start && -chmod 777 /run/php/php8.1-fpm.sock && -nginx -g 'daemon off;' \ No newline at end of file +function start() { + echo "Starting PHP & Nginx" + /etc/init.d/php8.1-fpm start && + chmod 777 /run/php/php8.1-fpm.sock && + nginx -g 'daemon off;' +} + +# Start Nginx and retry if it fails +until start; do + echo "Nginx failed to start, retrying in 5 seconds..." + sleep 5 +done \ No newline at end of file