Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions file-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
FROM node:20-alpine

ARG REGISTRY
ARG REGISTRY_TOKEN
ARG TAG
RUN if [[ ! -z "$REGISTRY_TOKEN" ]]; then echo "//$REGISTRY/:_authToken=$REGISTRY_TOKEN" >> ~/.npmrc ; fi
RUN if [[ ! -z "$REGISTRY" ]] ; then npm config set @flowfuse:registry "https://$REGISTRY"; fi

WORKDIR /usr/src/flowforge-file-server
RUN mkdir app bin etc var
COPY package.json /usr/src/flowforge-file-server/app
WORKDIR /usr/src/flowforge-file-server/app
RUN npm install --production --no-audit --no-fund
RUN --mount=type=secret,id=npm,target=/root/.npmrc npm install --production --no-audit --no-fund
ENV FLOWFORGE_HOME=/usr/src/flowforge-file-server

LABEL org.label-schema.name="FlowFuse File Storage" \
Expand Down
7 changes: 1 addition & 6 deletions flowforge-docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
FROM node:20-alpine

ARG REGISTRY
ARG REGISTRY_TOKEN
RUN if [[ ! -z "$REGISTRY_TOKEN" ]]; then echo "//$REGISTRY/:_authToken=$REGISTRY_TOKEN" >> ~/.npmrc ; fi
RUN if [[ ! -z "$REGISTRY" ]] ; then npm config set @flowfuse:registry "https://$REGISTRY"; fi

RUN apk add --no-cache --virtual build-base g++ make py3-pip sqlite-dev python3 git

WORKDIR /usr/src/forge
Expand All @@ -15,7 +10,7 @@ RUN ./install-device-cache.sh && rm install-device-cache.sh
WORKDIR /usr/src/forge
COPY package.json /usr/src/forge/app
WORKDIR /usr/src/forge/app
RUN npm install --production --no-audit --no-fund
RUN --mount=type=secret,id=npm,target=/root/.npmrc npm install --production --no-audit --no-fund

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not work when built via the Build and push containers pipeline. Is this expected?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should work if the secret is not set/empty, why will it fail?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I used wrong words - image build will complete with success. We do not provide any secrets in the workflow, so the /root/.npmrs file will be empty, though.

ENV FLOWFORGE_HOME=/usr/src/forge

Expand Down
6 changes: 1 addition & 5 deletions node-red-container/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
FROM nodered/node-red:3.1.15-18

ARG REGISTRY
ARG REGISTRY_TOKEN
ARG BUILD_TAG=latest
RUN if [[ ! -z "$REGISTRY_TOKEN" ]]; then echo "//$REGISTRY/:_authToken=$REGISTRY_TOKEN" >> ~/.npmrc ; fi
RUN if [[ ! -z "$REGISTRY" ]] ; then npm config set @flowfuse:registry "https://$REGISTRY"; fi

COPY healthcheck.js /healthcheck.js

Expand All @@ -21,7 +17,7 @@ RUN chown -R node-red:node-red /usr/src/flowforge-nr-launcher
RUN ln -s /usr/src/flowforge-nr-launcher /usr/src/flowfuse-nr-launcher

USER node-red
RUN npm install @flowfuse/nr-launcher@${BUILD_TAG}
RUN --mount=type=secret,id=npm,target=/usr/src/node-red/.npmrc npm install @flowfuse/nr-launcher@${BUILD_TAG}

USER root
RUN mkdir -p /data/storage
Expand Down