本文介绍了如何在Docker容器上部署php-fpm和在localhost(Ubuntu)上部署apache/nginx的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们可以将apache和php部署在单独的docker容器中,然后进行链接.

We can deploy apache and php in separate docker containers and then link them.

但是有什么方法可以在本地安装apache(使用apt-get install apache2)和php-fpm并在docker容器中进行链接?

But is there any way to install apache locally (using apt-get install apache2) and php-fpm in docker container and then link them?

谢谢

推荐答案

您可以构建自己的映像,并在Dockerfile中可以 apt install ...

you can build your own image and in the Dockerfile you can apt install ...

,但是这里还有一个带有apache + php-fpm的官方映像: https://hub.docker.com/_/php

but there is also an official image with apache + php-fpm here: https://hub.docker.com/_/php

所以您不必.准备好了.

so you dont have to. its ready to go.

但是我相信它可以通过公开您的 php-fpm 端口并将您的Apache FastCgiExternalServer配置为该端口而不是unix套接字来起作用.

but i believe it could work by exposing your php-fpm port and configuring your apache FastCgiExternalServer to this port instead of a unix socket.

这篇关于如何在Docker容器上部署php-fpm和在localhost(Ubuntu)上部署apache/nginx的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 18:29