Docker example build fail due to POSTGRESQL_URL environment variable
See original GitHub issuein docker example, Step 9/13 : RUN prisma2 generate
fails.
I have the following error:
Error: Schema parsing error: Environment variable not found: POSTGRESQL_URL.
--> /opt/app/prisma/schema.prisma:4
|
3 | // Like, postgresql://user:password@localhost:5432/database/schema
4 | url = env("POSTGRESQL_URL")
5 | }
|
why url is needed at build time?
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Docker-compose environment variables - Stack Overflow
I get an authentication error if I enter the incorrect password. ... Thanks to Bryan with the docker-compose exec containername env I have...
Read more >Use containers for development | Docker Documentation
Learn how to develop your application locally.
Read more >Containerize Redwood Sides with Docker Compose
This example containerizes Redwood's Web and API sides into individual containers that can be run with Docker Compose.
Read more >Introduction to Prisma with Docker - Section.io
We will build a simple server that accesses Prisma to read its database schema and run it on a Docker container.
Read more >Dockerizing a NestJS app with Prisma and PostgreSQL
Docker enables you to build consistent containers of your ... datasource db { provider = "postgresql" url = env("DATABASE_URL") } ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, of course, it makes sense. But at this point, (build time) there is no need to evaluate the variable, no ?
The workaround works with an empty string. I think prisma doesn’t need to know the value of the environment var to generate the client. It just needs to know that the final value will be provided thought this variable.
Thanks a lot for opening this issue @lvauvillier 🙏
We’ll be fixing the Docker example soon, we created another issue to track this here: https://github.com/prisma/prisma-examples/issues/1437