You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When deploying to Coherence, the web's build string has to be: build: ["yarn", "rw", "build", "web", "--no-prerender"]. We can't prerender because the DATABASE_URL env var isn't supplied to the web's build container. When the web side prerenders, it doesn't actually make a call to the api server over the network. Instead it imports the GraphQL handler directly from the api side and runs it programmatically. This means it needs access to the database for the underlying prisma calls. This also means the build container for the web side can't just contain web-side code—it needs the whole project more or less.
How do we reproduce the bug?
Setup up coherence deploy:
yarn rw setup deploy coherence
remove the --no-prerender line from the build command in coherence.yml and replace it with this (this handles initial deploy where the database hasn't been provisioned yet):
With multi-stage builds, you use multiple FROM statements in your Dockerfile. Each FROM instruction can use a different base, and each of them begins a new stage of the build. You can selectively copy artifacts from one stage to another, leaving behind everything you don’t want in the final image.
For the Web Dockerfile, we can start with both API and Web, run through the steps, then remove API.
Note: We need to make API Build, Prisma Migrate, and Data-migrate have completed successfully before Building Web and running prerender.
What's not working?
When deploying to Coherence, the web's build string has to be:
build: ["yarn", "rw", "build", "web", "--no-prerender"]
. We can't prerender because theDATABASE_URL
env var isn't supplied to the web's build container. When the web side prerenders, it doesn't actually make a call to the api server over the network. Instead it imports the GraphQL handler directly from the api side and runs it programmatically. This means it needs access to the database for the underlying prisma calls. This also means the build container for the web side can't just contain web-side code—it needs the whole project more or less.How do we reproduce the bug?
Setup up coherence deploy:
--no-prerender
line from thebuild
command incoherence.yml
and replace it with this (this handles initial deploy where the database hasn't been provisioned yet):What's your environment? (If it applies)
Are you interested in working on this?
The text was updated successfully, but these errors were encountered: