Added node-red and pgadmin to the apps role
This commit is contained in:
@@ -0,0 +1,104 @@
|
||||
FROM docker.io/almalinux/9-base:latest AS base
|
||||
|
||||
ARG NODE_VERSION=20
|
||||
ARG NODE_RED_VERSION={{ nodered_version }}
|
||||
|
||||
|
||||
# Copy scripts
|
||||
COPY scripts/*.sh /tmp/
|
||||
COPY healthcheck.js /
|
||||
|
||||
|
||||
# Install tools, create Node-RED app and data dir, add user and set rights
|
||||
RUN set -ex && \
|
||||
dnf update -y && dnf install -y epel-release \
|
||||
&& dnf install -y --allowerasing bash tzdata curl nano wget git openssl ca-certificates iputils \
|
||||
&& mkdir -p /usr/src/node-red /data \
|
||||
&& dnf module -y enable nodejs:${NODE_VERSION} \
|
||||
&& dnf install -y nodejs \
|
||||
&& dnf clean all \
|
||||
## && deluser --remove-home node \
|
||||
# adduser --home /usr/src/node-red --disabled-password --no-create-home node-red --uid 1000 && \
|
||||
&& useradd --home-dir /usr/src/node-red --uid 1000 node-red \
|
||||
&& chown -R node-red:root /data && chmod -R g+rwX /data \
|
||||
&& chown -R node-red:root /usr/src/node-red && chmod -R g+rwX /usr/src/node-red
|
||||
# chown -R node-red:node-red /data && \
|
||||
# chown -R node-red:node-red /usr/src/node-red
|
||||
|
||||
# Set work directory
|
||||
WORKDIR /usr/src/node-red
|
||||
|
||||
# Setup SSH known_hosts file
|
||||
#COPY known_hosts.sh .
|
||||
#RUN ./known_hosts.sh /etc/ssh/ssh_known_hosts && rm /usr/src/node-red/known_hosts.sh
|
||||
#RUN echo "PubkeyAcceptedKeyTypes +ssh-rsa" >> /etc/ssh/ssh_config
|
||||
|
||||
# package.json contains Node-RED NPM module and node dependencies
|
||||
COPY package.json .
|
||||
COPY flows.json /data
|
||||
COPY scripts/entrypoint.sh .
|
||||
RUN chmod u+x ./entrypoint.sh
|
||||
|
||||
#### Stage BUILD #######################################################################################################
|
||||
FROM base AS build
|
||||
|
||||
# Install Build tools
|
||||
RUN dnf update -y && dnf install -y epel-release python \
|
||||
&& dnf clean all \
|
||||
&& rm -rf /var/cache/* /var/log* /tmp/*
|
||||
|
||||
RUN npm install --unsafe-perm --no-update-notifier --no-fund --only=production && \
|
||||
npm uninstall node-red-node-gpio && \
|
||||
cp -R node_modules prod_node_modules
|
||||
|
||||
#### Stage RELEASE #####################################################################################################
|
||||
FROM base AS release
|
||||
ARG BUILD_DATE
|
||||
ARG BUILD_VERSION
|
||||
ARG BUILD_REF
|
||||
ARG NODE_RED_VERSION
|
||||
ARG ARCH
|
||||
ARG TAG_SUFFIX=default
|
||||
|
||||
LABEL org.label-schema.build-date=${BUILD_DATE} \
|
||||
org.label-schema.docker.dockerfile="nodered/Containerfile" \
|
||||
org.label-schema.license="Apache-2.0" \
|
||||
org.label-schema.name="Node-RED" \
|
||||
org.label-schema.version=${BUILD_VERSION} \
|
||||
org.label-schema.description="Low-code programming for event-driven applications." \
|
||||
org.label-schema.url="https://nodered.org" \
|
||||
org.label-schema.vcs-ref=${BUILD_REF} \
|
||||
org.label-schema.vcs-type="Git" \
|
||||
org.label-schema.vcs-url="https://github.com/node-red/node-red-docker" \
|
||||
org.opencontainers.image.source="https://github.com/node-red/node-red-docker" \
|
||||
org.label-schema.arch=${ARCH} \
|
||||
authors="Dave Conway-Jones, Nick O'Leary, James Thomas, Raymond Mouthaan"
|
||||
|
||||
COPY --from=build /usr/src/node-red/prod_node_modules ./node_modules
|
||||
|
||||
# Chown, install devtools & Clean up
|
||||
RUN chown -R node-red:root /usr/src/node-red \
|
||||
&& dnf update -y && dnf install -y python-devel python3 \
|
||||
&& dnf groupinstall -y "Development Tools" \
|
||||
&& rm -r /tmp/*
|
||||
|
||||
RUN npm config set cache /data/.npm --global
|
||||
|
||||
USER node-red
|
||||
|
||||
# Env variables
|
||||
ENV NODE_RED_VERSION=$NODE_RED_VERSION \
|
||||
NODE_PATH=/usr/src/node-red/node_modules:/data/node_modules \
|
||||
PATH=/usr/src/node-red/node_modules/.bin:${PATH} \
|
||||
FLOWS=flows.json
|
||||
|
||||
# ENV NODE_RED_ENABLE_SAFE_MODE=true # Uncomment to enable safe start mode (flows not running)
|
||||
# ENV NODE_RED_ENABLE_PROJECTS=true # Uncomment to enable projects option
|
||||
|
||||
# Expose the listening port of node-red
|
||||
EXPOSE 1880
|
||||
|
||||
# Add a healthcheck (default every 30 secs)
|
||||
HEALTHCHECK CMD node /healthcheck.js
|
||||
|
||||
ENTRYPOINT ["./entrypoint.sh"]
|
||||
@@ -0,0 +1 @@
|
||||
podman build --tag node-red:{{node-red_version}} .
|
||||
@@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=Node-Red Container
|
||||
After=network-online.target
|
||||
|
||||
[Container]
|
||||
#Image=docker.io/nodered/node-red:{{ nodered_version }}
|
||||
Image={{podman_registry}}/node-red:{{ nodered_version }}
|
||||
ContainerName=node-red
|
||||
Volume=node-red:/data:Z
|
||||
PublishPort=0.0.0.0:1880:1880
|
||||
|
||||
[Service]
|
||||
Restart=Always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user