[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
- Impossible to create project via CLI?
Is it possible to create a new project via the appwrite CLI ? I need to create a few projects for something I'm working on and because i don't want to do it man...
- Help Needed: "The current user has been ...
Facing a 403 Forbidden error with the message "The current user has been blocked" while trying to log in via GitHub and Email/Password. This is happening on a ...
- Unable to signup to appwrite cloud
When attempting to create an online cloud account on appwrite.io, I get the following message : "This email address must already be in its canonical form. Pleas...