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.

Works locally but not when generated inside Dockerfile (node:15)

See original GitHub issue

Error:

#14 0.689 > npx prisma generate
#14 0.689
#14 2.049 Prisma schema loaded from prisma/schema.prisma
#14 16.61 Error:
#14 16.61 Error: Command failed: /app/node_modules/.bin/mmdc -i /tmp/prisma-erd-iGMeMD/prisma.mmd -o /app/prisma/ERD.pdf -t forest -c /tmp/prisma-erd-iGMeMD/config.json
#14 16.61     at checkExecSyncError (node:child_process:707:11)
#14 16.61     at Object.execSync (node:child_process:744:15)
#14 16.61     at Object.exports.default [as onGenerate] (/app/node_modules/prisma-erd-generator/dist/generate.js:187:23)
#14 16.61     at processTicksAndRejections (node:internal/process/task_queues:94:5)
#14 16.61     at async LineStream.<anonymous> (/app/node_modules/prisma-erd-generator/node_modules/@prisma/generator-helper/dist/generatorHandler.js:36:24)
#14 16.61
#14 16.61
#14 16.61 ✔ Generated Prisma JSON Schema Generator to ./prisma/generated in 
38ms
#14 16.61
#14 16.61 ✔ Generated DBML Schema to ./prisma/generated in 40ms
#14 16.61
#14 16.61 ✔ Generated Prisma Docs Generator to ./prisma/generated/database-docs in 116ms
#14 16.61
#14 16.61 ✔ Generated Prisma Client (2.27.0) to ./node_modules/@prisma/client in 573ms
#14 16.61
#14 16.61 ✔ Generated Prisma NestJS/GraphQL to ./node_modules/@prisma/client/nestjs-graphql in 11.67s
#14 16.61
------
executor failed running [/bin/sh -c npm run prebuild]: exit code: 1

Version: "prisma-erd-generator": "^0.8.1"

Generator Part inside schema.prisma:

...
generator erd {
  provider = "prisma-erd-generator"
  output   = "./ERD.pdf"
}
...

Dockerfile:

FROM node:15-alpine AS builder
WORKDIR /app
COPY package*.json ./
COPY tsconfig*.json ./
COPY nest-cli.json ./
COPY ./src/ ./src/
COPY ./prisma/ ./prisma/
RUN npm ci --quiet
RUN npx prisma generate # <= failing line

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
TMInnovationscommented, Mar 31, 2022

Sorry to have to reopen this.

Am I right? => In 0.9.1 it’s still not possible to generate the erd inside a docker build. So this issue is not resolved, is it? If you don’t want to address this issue I can also try to contribute if you tell me where to start. 😃

All the best, Thomas

1reaction
keonikcommented, Jan 18, 2022

I can replicate. The last version to work with docker was 0.6.1. I need to dig through the commits to see what happened in 0.7.0 to see if there is a way to make everyone’s use case work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

node:7.9-alpine unable to build package due python is not ...
Everything works just fine on my mac but when I run it on Docker yarn ... node-pre-gyp ERR! not ok Failed to execute...
Read more >
Docker Container works locally but fails on server
I managed to run it locally through my docker container. It works great, but when I try running it from my server it...
Read more >
Containerize an application - Docker Documentation
A Dockerfile contains a script of instructions that Docker uses to create a container image. In the app directory, the same location as...
Read more >
Docker for Node.js Developers: 5 Things You Need to Know ...
Running your Node.js application in a Docker container can be as simple as copying over the project's directory and installing all the required ......
Read more >
Best practices for writing Dockerfiles - Docker Documentation
The image defined by your Dockerfile should generate containers that are as ... the build context can be useful in situations where your...
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