Question: How do you organize the Dockerfiles belonging to a project when you have one Dockerfile for the database, one for the application server, and so on? Do you create some sort of hierachy in the source?
A big enterprise project can't consist of only one Dockerfile?

Answer: 
Author's Note
=============

**This answer is out of date.** Fig no longer exists and has been replaced by [Docker compose](https://docs.docker.com/compose/).
Accepted answers cannot be deleted.

Docker Compose supports the building of project hierachy. So it's now easy to support a Dockerfile in each sub directory.

```
├── docker-compose.yml
├── project1
│   └── Dockerfile
└── project2
    └── Dockerfile

```

---

Original answer
---------------

I just create a directory containing a Dockerfile for each component. Example:

* [Setting up a docker / fig Mesos environment](https://stackoverflow.com/questions/25217208/setting-up-a-docker-fig-mesos-environment/25218202#25218202)

When building the containers just give the directory name and Docker will select the correct Dockerfile.
In Intellij, I simply changed the name of the docker files to \*.Dockerfile, and associated the file type \*.Dockerfile to docker syntax.