Newbie help: Node.js app using Dockerfile memory-hog.js + memory-check.js

Hello, I want to create a node.js app using those 2 scripts shown up in SCR1

I’ve put them into my /workspace/app folder
Got my Dockerfile in /workspace
And my Dockerfile looks like this: SCR2

But I constantly get the error “ERR_INVALID_ARG_TYPE”

When I start the app it should check if there is enough memory to run and if not, exit.
While running it should check every 5seconds if there is more memory allocated as allowed. If it does it should say its unhealthy.
The logic is inside those scripts but I have no idea how to put them together without any error.

This is the run output I get: SCR3

That is a NodeJS error, not related to Docker. writeFileSync() expects the data as string but you multipled the number in the environment variable converting it to an actual number. You need to convert it back probably by using allocatedMb.toString() but I am not a NodeJS developer so use the way which is recommended in NodeJS.

Note: Please, don’t share screenshots of codes. It makes the code harder to read, impossible to copy and search for an error message and depending on the size of the screen and the size of the picture we even need to zoom on it.

Some tips to format your post properly: