Answer the question
In order to leave comments, you need to log in
How to properly cross docker containers?
I can't figure out how to link together two apache and php docker containers - this one and this one .
Those. the option is clear when apache and php are in the same container, but to make these two work together?
Answer the question
In order to leave comments, you need to log in
It all depends on the interaction model between apache and php that you require.
Roughly speaking: how many processes - so many containers.
If you look closely at the versions of the php images, you can see that they provide different tools (look at CMD
in Dockerfile
). So, for example, 7.0-fpm
an image is a php-fpm
daemon process. But this 7.0-cli
is just launching the php interpreter in interactive mode ( php -a
). The version 7.0-apache
is generally an Apache server that can run php scripts.
Accordingly, if you need an Apache + php-fpm model, then we take a container apache
and knit it with a php:fpm
. If you need Apache to run php scripts directly, take one php:apache
.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question