Skip to content

Conversation

@Vincent-Ngobeh
Copy link

#Summary

Use Docker Compose 'required: false' option for env_file entries to make environment files optional. This allows CI to run successfully when env files are not committed to version control, while still using them when present for local development.

Fix #5319

Description

Use Docker Compose required: false option for env_file entries to make environment files optional.

Checklist:

  • I've made sure that tests are updated accordingly (especially if adding or updating a template option)
  • I've updated the documentation or confirm that my change doesn't require any updates

Rationale

When keep_local_envs_in_vcs is set to n, the .envs/.local/ files are gitignored and not committed to version control. However, Docker Compose fails in CI when it cannot find the referenced env files.

This fix uses Docker Compose's required: false option (available since v2.24.0) to make the env files optional:

  • ✅ Local development works (env files used when present)
  • ✅ CI passes (missing files are ignored)
  • ✅ No breaking changes to existing behavior

…isabled

Use Docker Compose 'required: false' option for env_file entries to make
environment files optional. This allows CI to run successfully when env files
are not committed to version control, while still using them when present
for local development.

Fix cookiecutter#5319
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Github CI fails when docker is on and keep_local_envs_in_vcs is off

1 participant