mirror of
https://github.com/hassio-addons/addon-node-red.git
synced 2025-05-07 04:21:31 +00:00
Apply Node-RED dashboard patch at build time (#1579)
This commit is contained in:
parent
84313f5818
commit
ac346d4c8d
3 changed files with 5 additions and 5 deletions
|
@ -4,6 +4,7 @@ FROM ${BUILD_FROM}
|
|||
|
||||
# Copy Node-RED package.json
|
||||
COPY package.json /opt/
|
||||
COPY node-red-dashboard-show-dashboard.patch /tmp/
|
||||
|
||||
# Set workdir
|
||||
WORKDIR /opt
|
||||
|
@ -26,7 +27,7 @@ RUN \
|
|||
nodejs=18.14.2-r0 \
|
||||
npm=9.1.2-r0 \
|
||||
openssh-client=9.1_p1-r2 \
|
||||
patch=2.7.6-r8 \
|
||||
patch=2.7.6-r9 \
|
||||
\
|
||||
&& npm install \
|
||||
--no-audit \
|
||||
|
@ -40,6 +41,9 @@ RUN \
|
|||
\
|
||||
&& echo -e "StrictHostKeyChecking no" >> /etc/ssh/ssh_config \
|
||||
\
|
||||
&& patch -d /opt/node_modules/node-red-dashboard -p1 \
|
||||
-i /tmp/node-red-dashboard-show-dashboard.patch \
|
||||
\
|
||||
&& apk del --no-cache --purge .build-dependencies \
|
||||
&& rm -fr \
|
||||
/etc/nginx \
|
||||
|
|
|
@ -38,10 +38,6 @@ if ! bashio::fs.directory_exists '/config/node-red/'; then
|
|||
sed -i "s/%%ID%%/${id}/" "/config/node-red/flows.json"
|
||||
fi
|
||||
|
||||
# Patch Node-RED Dashboard
|
||||
cd /opt/node_modules/node-red-dashboard || bashio.exit.nok 'Failed cd'
|
||||
patch -p1 < /etc/node-red/patches/node-red-dashboard-show-dashboard.patch
|
||||
|
||||
# Pass in port & SSL settings
|
||||
port=$(bashio::addon.port 80)
|
||||
sed -i "s/%%PORT%%/${port:-80}/" "/opt/node_modules/node-red-dashboard/nodes/ui_base.html"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue