Structuring the project with Docker Compose

I’m using Docker Compose for my dev needs. It works perfectly while just mapping source tree into container with volume. But now I need to build production image to be deployed onto Docker Machine/Swarm. By ‘production image’ I mean not using the volume(s) to map project source tree into container’s directory but copying source tree with COPY command in Dockerfile. It turns out that Dockerfile could not “jump outside” of its directory. I.e. I had to place project source tree as subdirectory into one that has Dockerfile, docker-compose.yml, etc. This setup can be used of course (and I still use it!). But it leads to necessity of using git subtree and moreover makes that extra directory dirty and unpleasant: if we need several Dockerfiles for different services (web, db, cache, etc.) we must name them with distinct names, use these ‘non-default’ names in docker-compose.yml, etc. Are there anyone who faced with the same issue and managed to handle it in elegant way?