This commit is contained in:
franknstayn
2023-08-30 01:03:25 +08:00
parent b9d395f7b4
commit af1e3e0651
3 changed files with 13 additions and 4 deletions

View File

@@ -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"]

View File

@@ -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;

9
www.conf Normal file
View File

@@ -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