I'm trying to build a custom NR docker image that does a few things:
- Begins with nodered/node-red base image
- Clones a git repo that has my flows and packages (preferrably to /data/projects/myproject)
- Installs packages (npm install)
- Point application to run from my custom project directory instead of the default /data/flows.json
I really like the 'Projects' feature and would like to have my custom image run from the project of my choice.
I have steps 1-3 working but am not sure how to manipulate the files in order to launch the custom project?
I've enabled the projects feature in my docker-compose.yml file (NODE_RED_ENABLE_PROJECTS=true) but I have to manually go into the editor and select my 'project' manually.
Can I define this ahead of time in the Dockerfile?
Dockerfile so far:
FROM nodered/node-red
#Create projects directory
RUN mkdir /data/projects
#Clone the most up to date version of the code
WORKDIR /data/projects
RUN git clone https://token@gitsite.com/myCustomProject
WORKDIR /data/projects/myCustomProject
# Copy in the Root CA to avoid SSL errors
COPY ./ca-bundle.crt /usr/local/share/ca-certificates/ca-bundle.crt
RUN update-ca-certificates
# Copy package.json to the WORKDIR so npm builds all
# of your added nodes modules for Node-RED
#COPY package.json .
RUN npm config set strict-ssl false
RUN npm install
#--unsafe-perm --no-update-notifier --no-fund --only=production
#make node red run from the /data/projects/myCustomProject directory??