From af1e3e065191607d325848fbf9ba650e993aa0e9 Mon Sep 17 00:00:00 2001 From: franknstayn Date: Wed, 30 Aug 2023 01:03:25 +0800 Subject: [PATCH] upadted --- Dockerfile | 6 +++--- default.conf | 2 +- www.conf | 9 +++++++++ 3 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 www.conf diff --git a/Dockerfile b/Dockerfile index 283b212..534235f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,8 +14,6 @@ RUN apk --update --no-cache add \ && docker-php-ext-configure gd --with-freetype --with-jpeg \ && docker-php-ext-install gd pdo pdo_mysql zip mcrypt - - # Set the working directory in the container WORKDIR /var/www/html @@ -40,10 +38,12 @@ RUN composer install # Generate Laravel application key RUN php artisan key:generate +# Copy the www.conf file to PHP-FPM pool.d directory +COPY www.conf /usr/local/etc/php-fpm.d/www.conf + # Expose port 9000 for PHP-FPM EXPOSE 80 EXPOSE 9001 # Start PHP-FPM ENTRYPOINT ["/etc/entrypoint.sh"] - diff --git a/default.conf b/default.conf index 3115758..781a6f4 100644 --- a/default.conf +++ b/default.conf @@ -11,7 +11,7 @@ server { location ~ \.php { fastcgi_index index.php; - fastcgi_pass 192.168.111.129:9001; # Use the service name and exposed port + fastcgi_pass unix:/run/php-fpm.sock; include fastcgi_params; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_param PATH_INFO $fastcgi_path_info; diff --git a/www.conf b/www.conf new file mode 100644 index 0000000..46885d7 --- /dev/null +++ b/www.conf @@ -0,0 +1,9 @@ +; www.conf +[www] +listen = /run/php-fpm.sock +listen.owner = www-data +listen.group = www-data +listen.mode = 0660 + +user = www-data +group = www-data