This commit is contained in:
franknstayn
2023-08-28 04:20:39 +08:00
parent 69c83ba408
commit 11c0567766
3 changed files with 8 additions and 2 deletions

View File

@@ -21,6 +21,7 @@ WORKDIR /var/www/html
# Copy Nginx config # Copy Nginx config
COPY default.conf /etc/nginx/conf.d/default.conf COPY default.conf /etc/nginx/conf.d/default.conf
COPY entrypoint.sh /etc/entrypoint.sh
# Copy the Laravel application files to the container # Copy the Laravel application files to the container
COPY . . COPY . .
@@ -42,5 +43,5 @@ EXPOSE 80
EXPOSE 9001 EXPOSE 9001
# Start PHP-FPM # Start PHP-FPM
CMD ["php-fpm"] ENTRYPOINT ["/etc/entrypoint.sh"]

View File

@@ -11,7 +11,7 @@ server {
location ~ \.php { location ~ \.php {
fastcgi_index index.php; fastcgi_index index.php;
fastcgi_pass merchbay:9001; # Use the service name and exposed port fastcgi_pass 127.0.0.1:9001; # Use the service name and exposed port
include fastcgi_params; include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_INFO $fastcgi_path_info;

5
entrypoint.sh Normal file
View File

@@ -0,0 +1,5 @@
#!/usr/bin/env sh
set -e
php-fpm -D
nginx -g 'daemon off;'