-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Change the default filename for loading environment variables to .env.local #15681
Description
Problem
prisma loads DATABASE_URL from .env by default but I think it should be .env.local.
From my understanding, the convention is that to use .env file to store defaults that should be included in the repository and to use .env.local file to store secrets.
And I think DATABASE_URL is a secret. Something that should not be included in the repository.
Note: .env, .env.development, and .env.production files should be included in your repository as they define defaults. .env*.local should be added to .gitignore, as those files are intended to be ignored. .env.local is where secrets can be stored.
https://nextjs.org/docs/basic-features/environment-variables#default-environment-variables
Suggested solution
Change the default filename for loading environment variables to .env.local.
Alternatives
Add support for loading .env file variations: .env.*, .env.*.local.