Repository: cookiecutter/cookiecutter-django

Issue:
Add `compose` to the names of docker compose files
## 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.


Discussion:
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.
> 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`. 



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.

Resolving patch:
diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py
--- a/hooks/post_gen_project.py
+++ b/hooks/post_gen_project.py
@@ -78,7 +78,11 @@ def remove_docker_files():
     shutil.rmtree(".devcontainer")
     shutil.rmtree("compose")
 
-    file_names = ["local.yml", "production.yml", ".dockerignore"]
+    file_names = [
+        "docker-compose.local.yml",
+        "docker-compose.production.yml",
+        ".dockerignore",
+    ]
     for file_name in file_names:
         os.remove(file_name)
     if "{{ cookiecutter.editor }}" == "PyCharm":


Test patch:
diff --git a/docs/testing.rst b/docs/testing.rst
--- a/docs/testing.rst
+++ b/docs/testing.rst
@@ -19,7 +19,7 @@ You will get a readout of the `users` app that has already been set up with test
 
 If you set up your project to `develop locally with docker`_, run the following command: ::
 
-   $ docker compose -f local.yml run --rm django pytest
+   $ docker compose -f docker-compose.local.yml run --rm django pytest
 
 Targeting particular apps for testing in ``docker`` follows a similar pattern as previously shown above.
 
@@ -36,8 +36,8 @@ Once the tests are complete, in order to see the code coverage, run the followin
 
 If you're running the project locally with Docker, use these commands instead: ::
 
-   $ docker compose -f local.yml run --rm django coverage run -m pytest
-   $ docker compose -f local.yml run --rm django coverage report
+   $ docker compose -f docker-compose.local.yml run --rm django coverage run -m pytest
+   $ docker compose -f docker-compose.local.yml run --rm django coverage report
 
 .. note::
 
diff --git a/tests/test_cookiecutter_generation.py b/tests/test_cookiecutter_generation.py
--- a/tests/test_cookiecutter_generation.py
+++ b/tests/test_cookiecutter_generation.py
@@ -247,7 +247,13 @@ def test_djlint_lint_passes(cookies, context_override):
     # TODO: remove T002 when fixed https://github.com/Riverside-Healthcare/djLint/issues/687
     ignored_rules = "H006,H030,H031,T002"
     try:
-        sh.djlint("--lint", "--ignore", f"{autofixable_rules},{ignored_rules}", ".", _cwd=str(result.project_path))
+        sh.djlint(
+            "--lint",
+            "--ignore",
+            f"{autofixable_rules},{ignored_rules}",
+            ".",
+            _cwd=str(result.project_path),
+        )
     except sh.ErrorReturnCode as e:
         pytest.fail(e.stdout.decode())
 
@@ -268,7 +274,7 @@ def test_djlint_check_passes(cookies, context_override):
     ["use_docker", "expected_test_script"],
     [
         ("n", "pytest"),
-        ("y", "docker compose -f local.yml run django pytest"),
+        ("y", "docker compose -f docker-compose.local.yml run django pytest"),
     ],
 )
 def test_travis_invokes_pytest(cookies, context, use_docker, expected_test_script):
@@ -293,7 +299,7 @@ def test_travis_invokes_pytest(cookies, context, use_docker, expected_test_scrip
     ["use_docker", "expected_test_script"],
     [
         ("n", "pytest"),
-        ("y", "docker compose -f local.yml run django pytest"),
+        ("y", "docker compose -f docker-compose.local.yml run django pytest"),
     ],
 )
 def test_gitlab_invokes_precommit_and_pytest(cookies, context, use_docker, expected_test_script):
@@ -320,7 +326,7 @@ def test_gitlab_invokes_precommit_and_pytest(cookies, context, use_docker, expec
     ["use_docker", "expected_test_script"],
     [
         ("n", "pytest"),
-        ("y", "docker compose -f local.yml run django pytest"),
+        ("y", "docker compose -f docker-compose.local.yml run django pytest"),
     ],
 )
 def test_github_invokes_linter_and_pytest(cookies, context, use_docker, expected_test_script):
diff --git a/tests/test_docker.sh b/tests/test_docker.sh
--- a/tests/test_docker.sh
+++ b/tests/test_docker.sh
@@ -15,22 +15,22 @@ cookiecutter ../../ --no-input --overwrite-if-exists use_docker=y "$@"
 cd my_awesome_project
 
 # make sure all images build
-docker compose -f local.yml build
+docker compose -f docker-compose.local.yml build
 
 # run the project's type checks
-docker compose -f local.yml run django mypy my_awesome_project
+docker compose -f docker-compose.local.yml run django mypy my_awesome_project
 
 # run the project's tests
-docker compose -f local.yml run django pytest
+docker compose -f docker-compose.local.yml run django pytest
 
 # return non-zero status code if there are migrations that have not been created
-docker compose -f local.yml run django python manage.py makemigrations --dry-run --check || { echo "ERROR: there were changes in the models, but migration listed above have not been created and are not saved in version control"; exit 1; }
+docker compose -f docker-compose.local.yml run django python manage.py makemigrations --dry-run --check || { echo "ERROR: there were changes in the models, but migration listed above have not been created and are not saved in version control"; exit 1; }
 
 # Test support for translations
-docker compose -f local.yml run django python manage.py makemessages --all
+docker compose -f docker-compose.local.yml run django python manage.py makemessages --all
 
 # Make sure the check doesn't raise any warnings
-docker compose -f local.yml run \
+docker compose -f docker-compose.local.yml run \
   -e DJANGO_SECRET_KEY="$(openssl rand -base64 64)" \
   -e REDIS_URL=redis://redis:6379/0 \
   -e CELERY_BROKER_URL=redis://redis:6379/0 \
@@ -43,10 +43,10 @@ docker compose -f local.yml run \
   django python manage.py check --settings=config.settings.production --deploy --database default --fail-level WARNING
 
 # Generate the HTML for the documentation
-docker compose -f docs.yml run docs make html
+docker compose -f docker-compose.docs.yml run docs make html
 
 # Run npm build script if package.json is present
 if [ -f "package.json" ]
 then
-    docker compose -f local.yml run node npm run build
+    docker compose -f docker-compose.local.yml run node npm run build
 fi