Skip to content

Commit

Permalink
[Feature]: 企业版 docker 预装node-red #7002
Browse files Browse the repository at this point in the history
  • Loading branch information
hotlong committed Sep 19, 2024
1 parent 28d5124 commit 2acc81a
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
3 changes: 2 additions & 1 deletion deploy/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
storage
.env
mongo-data
info.json
info.json
yarn.lock
5 changes: 4 additions & 1 deletion deploy/enterprise/app/nodered/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ const lodash = require('lodash');
// Node-Red Configuration
// https://nodered.org/docs/user-guide/runtime/configuration

process.env.PORT = 3200;
const uiPort = process.env.NODERED_PORT || "1880";


const storageDir = path.join(process.env.STEEDOS_STORAGE_DIR, "data", "node-red");

Expand All @@ -17,5 +18,7 @@ module.exports = {
functionGlobalContext: {
lodash
},
uiPort,
httpStatic: path.join(__dirname, 'public'),
httpRoot: "/nodered/"
};
14 changes: 14 additions & 0 deletions deploy/enterprise/fs/opt/steedos/templates/nginx-app.conf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,20 @@ fi
proxy_pass http://localhost:3100/unpkg/;
}
location /nodered/ {
proxy_http_version 1.1;
proxy_buffering off;
proxy_max_temp_file_size 0;
proxy_redirect off;
proxy_set_header Host \$http_host/nodered/;
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto \$origin_scheme;
proxy_set_header X-Forwarded-Host \$origin_host;
proxy_set_header Connection "";
proxy_pass http://localhost:1880/nodered/;
}
location /nginx/ {
root ${NGINX_WWW_PATH};
try_files \$uri \$uri/ /index.html =404;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[program:nodered]
directory=/opt/steedos/nodered/
command=/opt/steedos/run-with-env.sh ./node_modules/.bin/node-red --settings settings.js
priority=15
autostart=true
autorestart=true
startsecs=0
startretries=3
stdout_logfile=/steedos-storage/logs/%(program_name)s/%(program_name)s-%(ENV_HOSTNAME)s.log
redirect_stderr=true
stdout_logfile_maxbytes=10MB
stderr_logfile_maxbytes=10MB
stdout_logfile_backups=2
stderr_logfile_backups=2
stdout_events_enabled=true
stderr_events_enabled=true

0 comments on commit 2acc81a

Please sign in to comment.