cookiecutter-django icon indicating copy to clipboard operation
cookiecutter-django copied to clipboard

Add `compose` to the names of docker compose files

Open mfosterw opened this issue 1 year ago • 3 comments

Description

local.yml, production.yml, and docs.yml should be renamed something with "compose" in it: I propose docker-compose.*

Rationale

The VSCode Docker extension needs "compose" in the filename to detect a docker compose file. This lets you right click on the file to run compose commands using it. Also, it puts the files next to each other alphabetically, and perhaps most importantly, more clearly communicates the purpose of the files.

mfosterw avatar Apr 11 '24 04:04 mfosterw

I like the suggestion.

The main drawback would be that commands would be longer to type in the terminal. That can be fixed by wrapping the command in an alias or behind a tool like Makefile, or using launch configuration in IDE.

All the benefits you listed outweight this drawback in my opinion.

browniebroke avatar Apr 11 '24 11:04 browniebroke

The main drawback would be that commands would be longer to type in the terminal. That can be fixed by wrapping the command in an alias or behind a tool like Makefile, or using launch configuration in IDE.

The COMPOSE_FILE env var may tackle that issue.

I like the suggestion to so the files are grouped together if we name them like docker-compose.production.yml.

foarsitter avatar Apr 12 '24 07:04 foarsitter

I have been using this in my project and using the COMPOSE_FILE variable to improve convenience. I'll work on a PR for this soon, should be very quick.

mfosterw avatar Apr 13 '24 00:04 mfosterw