From 27c29acaeaf45b0db152f7232359b848a9448108 Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Sun, 23 Oct 2022 17:47:48 +0800 Subject: [PATCH] update: fastcgi use socket connection --- Dockerfile | 8 +++++--- nginx/kms.conf | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6aa882f..719caab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,12 +19,14 @@ RUN sed -i '/blahblah/i\return 0;' config.m4 && phpize && \ RUN strip /tmp/*.so* FROM alpine:3.16 AS asset +RUN apk add php8-fpm +WORKDIR /asset/etc/php8/ +RUN cat /etc/php8/php-fpm.conf | sed 's/^;\(pid\)/\1/' > php-fpm.conf +WORKDIR /asset/etc/php8/php-fpm.d/ +RUN cat /etc/php8/php-fpm.d/www.conf | sed 's?127.0.0.1:9000?/run/php-fpm.sock?' > www.conf COPY --from=vlmcsd /tmp/vlmcs* /asset/usr/bin/ COPY --from=iconv /tmp/libiconv.so.2 /asset/usr/local/lib/ COPY --from=iconv /tmp/iconv.so /asset/usr/lib/php8/modules/ -RUN apk add php8-fpm -WORKDIR /asset/etc/php8/ -RUN sed -i 's/^;\(pid\)/\1/' /etc/php8/php-fpm.conf && mv /etc/php8/php-fpm.conf ./ COPY ./nginx/ /asset/etc/nginx/ COPY ./ /asset/kms-server/ RUN ln -s /kms-server/kms.php /asset/usr/bin/kms-server diff --git a/nginx/kms.conf b/nginx/kms.conf index a6cb4a0..2b4d499 100644 --- a/nginx/kms.conf +++ b/nginx/kms.conf @@ -18,7 +18,7 @@ server { } include kms_params; include fastcgi_params; - fastcgi_pass 127.0.0.1:9000; + fastcgi_pass unix:/run/php-fpm.sock; fastcgi_param QUERY_STRING $query_param; fastcgi_param SCRIPT_FILENAME $kms_dir/src/Route.php; }