Skip to content

Instantly share code, notes, and snippets.

@WillSams
Created April 4, 2023 23:47
Show Gist options
  • Save WillSams/5d07f90a17ade3772978bb35a6c104d3 to your computer and use it in GitHub Desktop.
Save WillSams/5d07f90a17ade3772978bb35a6c104d3 to your computer and use it in GitHub Desktop.
ARG ARCH=""
FROM ${ARCH}node:16.20.0-alpine3.17
# Install Node.js and Node-RED
RUN apk add --no-cache \
python3 && \
apk add --no-cache --virtual .build-deps \
build-base gcc abuild binutils binutils-doc gcc-doc \
&& npm install -g npm \
&& apk del .build-deps
RUN if [ "$ARCH" = "${ARCH#*arm64}" ]; then \
export PATH="/opt/nodejs/bin:$PATH" && \
npm install --global --unsafe-perm [email protected]; \
else \
npm install --global --unsafe-perm [email protected]; \
fi
# todo: lock these down to the versions our devs have tested
RUN npm i -g @anl-ioc/[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
node-red-contrib-os@^0.2.1 \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected]
# Set the working directory to Node-RED's user data directory
WORKDIR /data
# Expose port 1880 for Node-RED
EXPOSE 1880
# We can use our own settings.js and flows.json
COPY settings.js /data/settings.js
COPY flows.json /data/flows.json
COPY certs /data/iot/certs
# Start Node-RED
CMD ["node-red"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment