I am finding the only way the Prisma schema can detect environment variables is to include a .env file in the root directory of its app.
I am using docker compose to build a few services, one of which is an app that manages a database using Prisma. The environmental variables is available in the app via process.env however Prisma can not detect this using the env function.
Here is how I am accessing the variable in schema.prisma:
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
And I am passing the variable in the docker compose in this way:
app:
build:
context: ./app
environment:
DATABASE_URL: ${DATABASE_URL}
How can I make this function detect environment variables that don't necessarily belong to a .env variable?