fix: restore Prisma cache env vars to prevent npm #37
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes the Prisma 403 error in Cloud Run where runtime tries to download binaries from npm
registry.
Root Cause
Commit b2a56a2 removed critical environment variables from the runtime `prisma
generate` command.
REMOVED (was working):
```dockerfile
RUN NPM_CONFIG_CACHE=/app/.cache/npm \
PRISMA_BINARY_CACHE_DIR=/app/.cache/prisma-python/binaries \
prisma generate
```
REPLACED WITH (broken):
```dockerfile
RUN prisma --version && \
prisma generate
```
Without these env vars, Prisma cannot find pre-cached binaries and attempts npm download →
403 error.
Solution
Restore `NPM_CONFIG_CACHE` and `PRISMA_BINARY_CACHE_DIR` to tell Prisma to use
pre-cached binaries at `/app/.cache/prisma-python/binaries`.
Type of change
Acceptance
Related