-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Armin Beck
committed
Jul 13, 2021
1 parent
fcd222c
commit 82c296a
Showing
5 changed files
with
36 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ LABEL org.label-schema.build-date=$BUILD_DATE \ | |
org.label-schema.vcs-ref=$VCS_REF | ||
|
||
#version | ||
ENV HILSCHERNETFIELD_NODERED_VERSION 1.0.1 | ||
ENV HILSCHERNETFIELD_NODERED_VERSION 1.0.2 | ||
|
||
#labeling | ||
LABEL maintainer="[email protected]" \ | ||
|
@@ -42,13 +42,10 @@ RUN apt-get update && apt-get -y install curl sudo build-essential python-dev py | |
&& echo ' "dependencies": {' >> package.json \ | ||
&& echo ' }' >> package.json \ | ||
&& echo '}' >> package.json \ | ||
#generate keys and self-signed certificate | ||
#prepare separate settings.js folder for Node-RED | ||
&& mkdir /root/settings/ \ | ||
&& cd /root/settings/ \ | ||
&& npm install when request \ | ||
&& mkdir -p /root/.node-red/certs \ | ||
&& cd /root/.node-red/certs \ | ||
&& openssl genrsa -out ./node-key.pem 2048 \ | ||
&& openssl req -new -sha256 -key ./node-key.pem -out ./node-csr.pem -subj "/C=DE/ST=Hessen/L=Hattersheim/O=Hilscher/OU=Hilscher/CN=myown/[email protected]" \ | ||
&& openssl x509 -req -in ./node-csr.pem -signkey ./node-key.pem -out ./node-cert.pem \ | ||
# -------------------- Install standard nodes from the community -------------------------------------------------------------- | ||
&& cd /root/.node-red/ \ | ||
# -------------------- Install OPC UA nodes and all dependencies -------------------- | ||
|
@@ -85,7 +82,7 @@ RUN apt-get update && apt-get -y install curl sudo build-essential python-dev py | |
|
||
# -------------------- Do all necessary copies -------------------- | ||
|
||
COPY "./auth/*" /root/.node-red/ | ||
COPY "./auth/*" /root/settings/ | ||
|
||
#copy files | ||
COPY "./init.d/*" /etc/init.d/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ LABEL org.label-schema.build-date=$BUILD_DATE \ | |
org.label-schema.vcs-ref=$VCS_REF | ||
|
||
#version | ||
ENV HILSCHERNETFIELD_NODERED_VERSION 1.0.1 | ||
ENV HILSCHERNETFIELD_NODERED_VERSION 1.0.2 | ||
|
||
#labeling | ||
LABEL maintainer="[email protected]" \ | ||
|
@@ -42,13 +42,10 @@ RUN apt-get update && apt-get -y install curl sudo build-essential python-dev py | |
&& echo ' "dependencies": {' >> package.json \ | ||
&& echo ' }' >> package.json \ | ||
&& echo '}' >> package.json \ | ||
#generate keys and self-signed certificate | ||
#prepare separate settings.js folder for Node-RED | ||
&& mkdir /root/settings/ \ | ||
&& cd /root/settings/ \ | ||
&& npm install when request \ | ||
&& mkdir -p /root/.node-red/certs \ | ||
&& cd /root/.node-red/certs \ | ||
&& openssl genrsa -out ./node-key.pem 2048 \ | ||
&& openssl req -new -sha256 -key ./node-key.pem -out ./node-csr.pem -subj "/C=DE/ST=Hessen/L=Hattersheim/O=Hilscher/OU=Hilscher/CN=myown/[email protected]" \ | ||
&& openssl x509 -req -in ./node-csr.pem -signkey ./node-key.pem -out ./node-cert.pem \ | ||
# -------------------- Install standard nodes from the community -------------------------------------------------------------- | ||
&& cd /root/.node-red/ \ | ||
# -------------------- Install OPC UA nodes and all dependencies -------------------- | ||
|
@@ -85,7 +82,7 @@ RUN apt-get update && apt-get -y install curl sudo build-essential python-dev py | |
|
||
# -------------------- Do all necessary copies -------------------- | ||
|
||
COPY "./auth/*" /root/.node-red/ | ||
COPY "./auth/*" /root/settings/ | ||
|
||
#copy files | ||
COPY "./init.d/*" /etc/init.d/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,8 +53,28 @@ else | |
fi | ||
|
||
|
||
if [ ! -e container_first_start ]; then | ||
|
||
echo "Container is starting the first time" | ||
|
||
#copy the settings file to the correct location | ||
cp /usr/lib/node_modules/node-red/settings.js /root/settings/settings.js | ||
|
||
|
||
#generate keys and self-signed certificate | ||
|
||
mkdir -p /root/.node-red/certs | ||
openssl genrsa -out /root/.node-red/certs/node-key.pem 4096 | ||
openssl req -new -sha256 -key /root/.node-red/certs/node-key.pem -out /root/.node-red/certs/node-csr.pem -subj "/C=DE/ST=Hessen/L=Hattersheim/O=Hilscher/OU=Hilscher/CN=$HOSTNAME/[email protected]" | ||
openssl x509 -req -days 365 -in /root/.node-red/certs/node-csr.pem -signkey /root/.node-red/certs/node-key.pem -out /root/.node-red/certs/node-cert.pem | ||
|
||
touch container_first_start | ||
|
||
fi | ||
|
||
|
||
# start Node-RED as background task | ||
/usr/bin/node-red flows.json & | ||
/usr/bin/node-red --settings /root/settings/settings.js flows.json & | ||
|
||
# wait forever not to exit the container | ||
while true | ||
|