When working on a project that requires the use of multiple dockerfiles, simply create each dockerfile in a separate directory. For instance,
app/ db/
Each of the above directories will contain their dockerfile. When an application is being built, docker will search all directories and build all dockerfiles.