我应该分别为Apache http服务器,php和memcached创build三个图像吗?

我在dockerizing一个php项目。 我的第一个问题是,为Apache http服务器,php和memcached分别创build三个图像是一个好习惯吗? 或者最好在php图像中安装memcached? 如果我要分别创build它们,那么如何configuration让Apache HTTP服务器支持PHP,换句话说就是让它们一起工作?

我build议你以这种方式使用图像。 把你的应用程序放到应用程序文件夹中,如果你想连接到memcached,主机是“memcached”

version: '3' services: app: image: php:apache container_name: app ports: - 80:80 volumes: - ./app/:/var/www/html/ memcache: image: memcached:alpine