New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow .direnvrc
to be defined in the project root
#908
Comments
Here's a hacky Gradle workaround in case anyone else needs it. This is from
|
Maybe another workaround is to rename the |
Yeah, I could add Also I guess I could do something similar with Still the problem is that |
Sure, I'm not neglecting this. This may also help: https://docs.docker.com/compose/compose-file/compose-file-v3/#env_file |
Thanks! |
I see that |
I still think this is valid. Example:
But let's see if someone else thinks the same. :) |
@felipecrs I do. I use .env by default when I run the project locally or in docker-compose and I don't want to copy-paste the same data to another file doing the same things. |
One tip: docker-compose can pickup environment variables from your terminal (loaded by direnv from .direnvrc), so perhaps you don't need .env. |
My app use dotenv already and .env while developing. So it's why we prefer keeping my .env and avoid a duplicate one 😉 |
Even if your app use dotenv, your app will also be able to pickup environment variables directly from the environment where you run it (which will have the vars already set by direnv). I have been using this approach to share environment variables during both Python debugging in VS Code and docker-compose. |
Maybe it's an old habit I have now and I could change it indeed 😉 |
haha, well, it was just a tip. It's a valid use-case even so. |
direnv
will try to read.env
files in subfolders in our project. We're using.env
for configuring docker-compose and nextjs in various subfolders of the project, and don't want to have to do adirenv allow
(or deny) for all of them.This needs to be a per-project thing, so specifying
skip_dotenv = true
in~/.config/direnv/direnv.toml
isn't really an option for us.Having a
.direnvrc
in the project root withskip_dotenv = true
would solve this.See #880 (comment)
The text was updated successfully, but these errors were encountered: