diff --git a/Dockerfile b/Dockerfile index e036936..c8d1dc5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,6 +21,7 @@ WORKDIR /var/www/html # Copy Nginx config COPY default.conf /etc/nginx/conf.d/default.conf +COPY entrypoint.sh /etc/entrypoint.sh # Copy the Laravel application files to the container COPY . . @@ -42,5 +43,5 @@ EXPOSE 80 EXPOSE 9001 # Start PHP-FPM -CMD ["php-fpm"] +ENTRYPOINT ["/etc/entrypoint.sh"] diff --git a/default.conf b/default.conf index 86e9646..13894c1 100644 --- a/default.conf +++ b/default.conf @@ -11,7 +11,7 @@ server { location ~ \.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; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_param PATH_INFO $fastcgi_path_info; diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..7636288 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +set -e + +php-fpm -D +nginx -g 'daemon off;' \ No newline at end of file