[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
- Need help migrating from self hosted to ...
Hi! I am using self hosted appwrite for testing stuff out and now it's prod ready I want to deplot it to the cloud version. It gave me this error when fetchin...
- Unable to Access Project Dashboard After...
I’m currently working on a team project using Appwrite and ran into an issue accessing my project dashboard. After clearing cookies and cache, I attempted to lo...
- Getting unwanted Errors
Whenever I try to open the app or access the admin panel, I encounter the same types of errors. I've tried multiple times, but the issue keeps recurring.
