Hi all, I have setup node-red in docker on ubuntu 16.04.6.
I have changed the settings.js (home/gaofei/.node-red) to
httpStatic: '/home/gaofei/img',
and I add a ui_template and config it as
<div class="c1">
<img src="/3.jpg" height="400" width="400" ><br/>
</div>
But the img can not be displayed successfully.
docker logs mynodered
> node-red-docker@1.0.6 start /usr/src/node-red
> node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS "--userDir" "/data"
17 May 08:35:18 - [info]
Welcome to Node-RED
===================
17 May 08:35:18 - [info] Node-RED version: v1.0.6
17 May 08:35:18 - [info] Node.js version: v10.20.1
17 May 08:35:18 - [info] Linux 4.4.0-151-generic x64 LE
17 May 08:35:18 - [info] Loading palette nodes
17 May 08:35:19 - [info] Dashboard version 2.22.1 started at /ui
17 May 08:35:19 - [info] Settings file : /data/settings.js
17 May 08:35:19 - [info] HTTP Static : /home/gaofei/img
17 May 08:35:19 - [info] Context store : 'default' [module=memory]
17 May 08:35:19 - [info] User directory : /data
17 May 08:35:19 - [warn] Projects disabled : editorTheme.projects.enabled=false
17 May 08:35:19 - [info] Flows file : /data/flows.json
17 May 08:35:19 - [info] Server now running at http://127.0.0.1:1880/
17 May 08:35:19 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
17 May 08:35:19 - [info] Starting flows
17 May 08:35:19 - [info] Started flows
17 May 08:36:16 - [info] Stopping flows
17 May 08:36:16 - [info] Stopped flows
17 May 08:36:16 - [info] Starting flows
17 May 08:36:16 - [info] Started flows
17 May 08:36:25 - [error] [file in:read mp3] Error: ENOENT: no such file or directory, open '/img/1.mp3'
If just running node-red in WIN10 or Ubuntu , not installed in docker ,the img can show successfully.
I have tried to change the ui path in settings.js and it works,so it proves that the settings.js file I modified is the correct one.
Could you please give some advise ?
Thanks .