1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Updated Design: Runnable Project (markdown)

Dave Conway-Jones 2018-04-05 14:22:25 +01:00
parent 963689405b
commit c4d3c2d230

@ -19,6 +19,7 @@ We can't quite do this today. Here are the missing pieces:
> DCJ: Are we pointing Node-RED or npm start ? Which are we calling to run it ? If npm start then don't we already have to be in the correct project directory ? (or use npm start --prefix projdir)
3. it must be possible to provide the credentialSecret for the project without it being part of any of the version controlled files. Options for this include:
- 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="..."`
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
@ -34,7 +35,14 @@ It could also provide a `bin` section that could allow starting via command line
### Runtime settings
When deploying the project, there will also be a need to have the runtime settings provided. These are not normally part of a project generated by Node-RED. The question is whether we have some tooling support to generate, or we just document how to do it. For example, the user would manually add a `settings.js` file to their project repo.
> DCJ: If we have the "add node-red as a dependency" checkbox - could it not also... "copy default settings.js into project" ? (but ensuring flowFile doesn't clash)
> DCJ: If we have the "add node-red as a dependency" checkbox - could it not also... "copy default settings.js into project" or create a minimal settings.js (i.e. without defaults and comments) ? (but ensuring flowFile doesn't clash) e.g.
```
module.exports = {
uiPort: process.env.PORT || 1880,
credentialSecret: process.env.NODE_RED_CREDENTIAL_SECRET
}
```
### Credentials
@ -55,7 +63,13 @@ We should also have an example Dockerfile that can be used to build and run a pr
# and about resin base images here: http://docs.resin.io/runtime/resin-base-images/
# Note the node:slim image doesn't have node-gyp
FROM resin/%%RESIN_MACHINE_NAME%%-node:8-slim
## Uncomment one of the following FROM lines to suit your environment
# For generic servers
#FROM node:8-slim
# For Pi...
FROM arm32v7/node:8-slim
# For Resin.io
#FROM resin/%%RESIN_MACHINE_NAME%%-node:8-slim
# Uncomment the next three lines if you want GPIO for Pi
#RUN apt-get update && apt-get install -yq \
@ -71,6 +85,7 @@ RUN JOBS=MAX npm install --production --unsafe-perm --no-optional && npm cache c
COPY . ./
ENV INITSYSTEM on
ENV HOST_IP=172.17.0.1
ENV NODE_PATH=/usr/src/app/node_modules
EXPOSE 1880