3

I am trying to setup set of docker containers to serve couple of applications. One of my goals is to isolate PHP applications from eachother.

I am new to Docker and not fully understand its concepts. So only idea i came up with is to create a dedicated php-fpm container per-application.

I started with official image: php:7.0-fpm but now I think that I may need to create my own general purpose pfp-fpm container (based on mentioned above), add some programs to it (such as ImageMagick) and instantiate couple of such php-fpm+stuff containers per PHP-application, setting up volume pointing strictly to that application source code.

Am I thinking in right direction?

1 Answer 1

3

now I think that I may need to create my own general purpose pfp-fpm container (based on mentioned above), add some programs to it

That is the idea: you can make a Dockerfile starting with FROM php:7.0-fpm, with your common programs installed in it.

Then you can make a multiple other Dockerfiles (each in their different folder), starting with FROM <yourFirstImage>, and declaring specifics to each php applications.

Sign up to request clarification or add additional context in comments.

4 Comments

In this case - requirements for all the apps are similar, this is not the point (but I got what you are saying, thank you!). Main question was - Do I really need to keep a container with FPM per-application I want to isolate?
And if it is so - how resource consuming is that? How can I measure how much ram or CPU I will spend on each PHP-FPM container instance?
@SmxCde "Do I really need to keep a container with FPM-per application I want to isolate?": yes, if you want to avoid any side-effect between each apps, as each one will run in its own machine (ows disk space and memory)
@SmxCde "how resource consuming is that?": it depends on their activity: as long as those apps are not doing much, it won't consume much if any CPU or even disk space, due to the copy-on-write mechanism.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.