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.

Prisma inside docker takes almost 300mb

See original GitHub issue

Converted the Discussion into an issue based on this internal convo.

Discussed in https://github.com/prisma/prisma/discussions/11572

<div type='discussions-op-text'>

Originally posted by vertti February 2, 2022 I was digging through my docker container that contains a simple app that uses Prisma.

Under node_modules you can see Prisma taking space like this: Screenshot 2022-02-02 at 17 06 03

total of 127MB. But slightly surprisingly, another 114 MB of Prisma stuff is found under .cache: Screenshot 2022-02-02 at 17 06 45

Are the .cache files necessary? Can I somehow avoid pulling those in? The total added size of Prisma is quite a lot!</div>

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:3
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
JardarTemalogiccommented, Dec 8, 2022

I did some work to reduce the size of prisma in production. The build is intended for Linux. And a Docerfile that works for me is:

RUN rm -rf node_modules/.cache/
RUN rm -rf node_modules/@prisma/engines/
RUN rm -rf node_modules/.prisma/client/query_engine-windows.dll.node
RUN rm -rf node_modules/prisma/

This results in a total size of 44MB:

41M     .prisma
2.9M    @prisma

The build only queries the database and I do not use migration in production.

1reaction
janpiocommented, Dec 20, 2022

(In our release 4.8.0 we have made significant improvements, average decrease of 50%, on the size of our engine files. That should ease the pain, but we will continue looking into other solutions of course. Expect more updates from us in this direction soon.)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does Prisma run in a Docker container instead of being a ...
I come from a Java ORM background where the ORM tools are all libraries in the form of JARs, like Hibernate. It seems...
Read more >
WFU - River Thames Conditions
Limited payout machines gauteng, Maneiro alfredo, Pumehana in english, ... Pangasinan resort near manaoag, Motorola newly launched mobile in india, ...
Read more >
docker-compose not recognizing prisma generate or changes
I have deleted node_modules multiple times and tried npx prisma generate but it's almost as if docker-compose is using the same old images....
Read more >
Untitled
Abdet status fb lucu, Richard abidin breen 2014, Jerry lokkeberg, Hevc movies 300mb, Seventy in kannada! Anjana qawwali indian idol, L'unhcr, Mba interview ......
Read more >
Dockerize Next.js With Prisma App | JavaScript in Plain English
In the end, I did manage to build an image but it was very large and it took me almost half an hour...
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