From de8d37bce9f04bf04f2b864b9be1388a1bcbefbd Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Thu, 5 Apr 2018 15:05:36 +0100 Subject: [PATCH] Updated Design: Runnable Project (markdown) --- Design:-Runnable-Project.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Design:-Runnable-Project.md b/Design:-Runnable-Project.md index 8b1f541..a31791a 100644 --- a/Design:-Runnable-Project.md +++ b/Design:-Runnable-Project.md @@ -23,6 +23,7 @@ We can't quite do this today. Here are the missing pieces: - env var - `NODE_RED_CREDENTIAL_SECRET` - [DCJ] easy to add to settings.js - `credentialSecret: process.env.NODE_RED_CREDENTIAL_SECRET` and would suit Docker style deploy. - command-line flag - `--credentialSecret="..."` + - [DCJ] added as option to runnable-project dev branch 4. Must handle running in a read-only environment. If the package is installed globally (in order to insert a command link into /usr/bin) then the flow file and settings.js will be in root space - which ought not to be writable by the user. Currently even starting Node-RED with -u option pointing somewhere protected will fail. Options include - just handling the error. @@ -56,13 +57,14 @@ When deploying a project, it may also need to have credentials provided. Normall We should also have an example Dockerfile that can be used to build and run a project. -> DCJ: Here is an example *Dockerfile.template* that works with resin.io - note that the flow file is set using the start command in package.json, and it needs node red as a dependency) +> DCJ: Here is an example *Dockerfile.template* that works with various flavours of Docker - note that the flow file is set using the start command in package.json, and it needs node red as a dependency) "scripts": {"start": "node node_modules/node-red/red.js flow.json"}, -```# base-image for node on any machine using a template variable, -# see more about dockerfile templates here: http://docs.resin.io/deployment/docker-templates/ -# and about resin base images here: http://docs.resin.io/runtime/resin-base-images/ +``` +# Expects -e NODE_RED_CREDENTIAL_SECRET="my_secret_key" to be part of the docker run command at start time +# and settings.js to exist as per above +# # Note the node:slim image doesn't have node-gyp ## Uncomment one of the following FROM lines to suit your environment