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.