The official docs use compose.yaml, but many tutorials still show docker-compose.yml. Is there a practical reason to pick one, or does either name work?
Is compose.yaml the better name, or is docker-compose.yml still fine?
Answers
Either is fine for normal Docker Compose use. The newer Compose command recognizes both names, so choose one and keep it consistent within a project. You are not doing anything wrong by using compose.yaml.
Reply to this answer
Iโd use compose.yaml for new projects. It is shorter and matches the naming used in current Compose documentation. The older docker-compose.yml name remains common because tutorials and existing projects have used it for years, not because it is inherently better.
Reply to this answer
One small practical wrinkle: scripts, deployment tools, or older Compose setups may expect a particular filename. If a project has automation around it, check that before renaming. Otherwise, both names are valid choices, and thereโs no need to migrate just for appearances.
Reply to this answer
Add your answer
Answers are reviewed before publication.
H6!PLL:
Good to know. So thereโs no benefit that would make switching an existing project worthwhile?
Knot~!5:
Usually not. If your current setup finds the file reliably, renaming is mostly a style choice.