[SOLVED] How to edit the source code after installing Appwrite locally using docker in Ubuntu?
- 0
- General
- Tools
What is the specs of that machine?
Ubuntu 22.04
I mean ram & cpu wise
Can you share screenshot
of htop
is it what you mean?
Yes
That's a pretty strong server
means my specs aren't the problem?
Open 2 terminals to the same server In one run
docker compose build
In the second have htop opened
To see when & what uses the RAM
Next you can edit the Dockerfile and add this before the RUN npm ci
ENV NODE_OPTIONS=--max_old_space_size=4096
RUN npm ci
RUN npm run build
Then run
docker compose build
Check more about it here
is it anything helpful?
Yes It seems like that it doen't use as much RAM as available Try to add the line from the last message and run it again
seems it worked now. but what was this magic? can you help me understand it?
Yes
Let's hope it will work 😉
When creating bundles with JS using <:vite:1007379819660595291> Vite or any other bundlers there's a huge amounts of files to process, and so many sub-process like tree-shaking etc. it's not too much to say that bundling JS file are one of the most resource consuming processes out there.
When the Dockerfile executing this command
RUN npm run build
It uses the default NODE_OPTIONS that have a smaller limit for RAM size. Because of that when JS uses all the available RAM it can't create any more variables in the heap and it crashes.
Adding the above command will force it to use 4096MB of RAM and this is more optimal for such a tasks.
It this makes sense?
makes so much sense. i wonder what's the default limit of RAM size you mentioned?
It seems like it is been decided in runtime by Node V8's unless you force by adding the setting
in this article, the auther says he got this number from a test. my current node version is 20.5.1. and in the command above, we again setting the limit to 4gb
Yes I read this one, but only setting it as flag helped it From what I've seen it's more about the calculation node is doing compere to available RAM
however. that might another whole topic to discuss about. but thanks for your help. really appreciate
[SOLVED] How to edit the source code after installing Appwrite locally using docker in Ubuntu?
Recommended threads
- Whats wrong here
I keep trying to fucking add the appwrite domains including CNAME and CAA but it keeps failing , this is the exact records i have right now in cf
- appwrite free plan resources issue
i'm on free plan and i just used 700MB bandwidth with 8mb storage and 141k requests, but when i'm trying to continue developing my app it send me an error messa...
- Startup credits or promo code inquiry fo...
Hello Appwrite team, Happy New Year! I hope you’re all doing well. I’m currently exploring backend solutions for a new SaaS project and Appwrite came highly re...