question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Docker example build fail due to POSTGRESQL_URL environment variable

See original GitHub issue

in 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:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
lvauvilliercommented, Dec 4, 2019

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.

0reactions
nikolasburkcommented, Feb 25, 2020

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found