Docker Compose堆栈设置为使用
nginx
服务作为前端,将PHP请求代理到
app
服务(php-fpm)。
这个
应用程序
服务应该
只有
正在运行php-fpm,而不是NGINX。通过覆盖图像的
CMD
,你不再跑步
php-fpm
这就是NGINX无法代理请求的原因。
从您的
Dockerfile
。。。
FROM php:8.1-fpm
# Install extensions necessary for Laravel and other dependencies
RUN docker-php-ext-install pdo pdo_mysql
# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- \
--install-dir=/usr/local/bin --filename=composer
重建您的
应用程序
服务形象
docker compose build app