Docker Project Layout
- Put the Compose file at the repository root (
compose.yamlordocker-compose.yml) - Put Dockerfiles, extra Compose overlays, entrypoints and image helper scripts under
docker/ - Keep a
.dockerignorenext to the image build context - Do not scatter one-off Dockerfiles at random paths
- A project that runs in containers ships Compose; do not leave “run the image by hand” as the only path
- Point Compose
build.contextat the repo (or the documented context), anddockerfileat the file underdocker/ - Do not add a second Compose stack that duplicates the first; overlay or a profile instead
Good:
compose.yamldocker/Dockerfiledocker/compose.override.yamlBad:
misc/app.dockerbackend/Dockerfilefrontend/Dockerfile# no Compose file