Installing via Docker problems

Hi. I've just moved from a RPi running HassOS for Home-Assistant which had everything setup lovely to going it on my own with Ubuntu18.04 headless server with docker-compose/portainer.

I have everything setup apart from Node-Red and could do with a bit of help debugging.
This is my compose file relevant to node-red:

node-red:
    container_name: Node-Red
    image: nodered/node-red-docker
    ports:
      - 1880:1880
    volumes:
      - /opt/node-red:/data:rw
    restart: "no"
    depends_on:
      - mosquitto
      - homeassistant

It's failing on basically everything:
https://pastebin.com/qcbHCHwR

Thank you in advance if anyone has any advice.
Christian

While not a docker expert by any means (I haven't used it) I do notice in your error log that you are tunning node.js v3.10.10 which is so old. Version 4 is end of life.

Notice the line: npm ERR! Make sure you have the latest version of node.js and npm installed.

I would start by upgrading node.js

Hi, thanks for your reply.
I don't control that, it's in the docker, so there's something wrong there.

I got it working using the image:
nodered/node-red-docker:latest

Although I also tried a few others like:
nodered/node-red-docker:v8

Which didn't work.
Thanks anyway, I'm going to go experiment.
Christian

I have just looked at the docker files - you might want to be careful - there is a couple of threads (as yet unresolved) about NR failing to upgrade/install with 19.4

I note that the docker image has that in there in the json file.

If i have time later today i will give it a go and see what happens on a Docker host i run

Craig

That is entirely unrelated.

@christianwaite the very first error in the log is:

Error: EACCES: permission denied, open '/data/settings.js'

Its failing to access the settings file from the volume you've mounted. Check its permissions etc. Have a Google for permissions issues with docker volumes... It's a common thing.

Thanks @knolleary for pointing me in the right direction.
Every other docker hasn't had a problem, but I found some information about node-red docker starting up with a different user. Someone updated their fstab to get around it, but I found this solution of setting the user a bit better. All working now (previously I thought it was a version thing, but I'd also disabled the volumes as well, which was actually the problem).

This is now my docker-compose:
node-red:
container_name: Node-Red
image: nodered/node-red-docker:latest
ports:
- 1880:1880
user: '1000'
volumes:
- /opt/node-red:/data
depends_on:
- homeassistant

Thanks for the tip
Christian

Great - glad you got it working.

Have to admit, I'm not as well versed in docker as I should be. Open to feedback on improvements we could make to fit in better with whatever the current widely accepted best practice is.

I'm very new to it, so I don't have much of a clue myself, but I'd maybe give an example of docker-compose like I've posted as that seems to be the easiest way to get everything going in my opinion.

Don't think we have anything about compose in the repo or docs, so would be a good contribution if anyone is willing.

Nick,

One of the key things would be to pass in the UID/GID of the user that you want to run the docker as - this then resolves issues with the mount of the external filesystem

Here is an example of one i use that supports this

https://hub.docker.com/r/linuxserver/sonarr/

P.S. I have been working with Docker for about a year now and use it farily extensively for a lot of tasks at home - happy to help out/get involved

regards

Craig