Custom node app not starting
-
@timconsidine said in Custom node app not starting:
PORT = ${CLOUDRON_MONGODB_PORT}
Is this correct? Why is the app listening on MONGODB's port?
-
@timconsidine said in Custom node app not starting:
Sep 06 13:14:40 at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
Sep 06 13:14:40code: 'EROFS',
Sep 06 13:14:40errno: -30,
Sep 06 13:14:40syscall: 'listen',
Sep 06 13:14:40address: '${CLOUDRON_MONGODB_PORT}',
Sep 06 13:14:40port: -1Per the above error, it looks like the app is trying to listen literally on the string
${CLOUDRON_MONGODB_PORT}
. i.e there is no environment variable expansion happenning. BTW, you might be wrongly assuming that you can even use environment variable in that .env file. -
@Kubernetes said in Custom node app not starting:
For PORT the ' characters are missing? Is that ok?
I assumed as numeric value they are not needed, but it's sure worth a try.
Thank you -
@girish said in Custom node app not starting:
Is this correct? Why is the app listening on MONGODB's port?
Hmmm, very good point.
I think I just assumed it was Mongo's port, but looking at the original repo, maybe it is not. Probably entirely my error. -
@girish said in Custom node app not starting:
BTW, you might be wrongly assuming that you can even use environment variable in that .env file.
Err, yes I was assuming and didn't start to think how they would be interpolated ! Thank you.
So what is best practice in this case ?
Construct the.env
file and populate values in the Dockerfile ? -
Ah !
Yes, I guess Dockerfile doesn't know these when the image is built.
Apologies, brain definitely slow.
Not sure if I should blame the heat or old age !
Thank you @girishAnd thank you @Kubernetes
Exactly the pointers I needed.
-
Yay !
Those corrections got me past the initial issue.
Some other problem now that I will investigate before sharing a repo in case useful to someone. -
Update :
Custom app now installed and working - thanks again @girish and @Kubernetes
Will make a repo and share link -
I have now created a repo for my custom package : https://git.cloudron.io/timconsidine/smsvoip-cloudron/
This packages a "desktop SMS" app which allows you to send/receive SMS on a virtual number (not your phone's number).
It is also useful for "fake" registrations for things like WhatsApp etc.