mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Updated Design: Runnable Project (markdown)
parent
c5162007e0
commit
900551251e
@ -32,7 +32,9 @@ When deploying the project, there will also be a need to have the runtime settin
|
|||||||
|
|
||||||
We should also have an example Dockerfile that can be used to build and run a project.
|
We should also have an example Dockerfile that can be used to build and run a project.
|
||||||
|
|
||||||
> DCJ: Here is an example that works with resin.io - note that the flow file is set as an ENV variable (for now) (and the package.json needs node red as a dependency)
|
> DCJ: Here is an example 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)
|
||||||
|
|
||||||
|
"scripts": {"start": "node node_modules/node-red/red.js flow.json"},
|
||||||
|
|
||||||
```# base-image for node on any machine using a template variable,
|
```# base-image for node on any machine using a template variable,
|
||||||
# see more about dockerfile templates here: http://docs.resin.io/deployment/docker-templates/
|
# see more about dockerfile templates here: http://docs.resin.io/deployment/docker-templates/
|
||||||
@ -54,16 +56,14 @@ RUN JOBS=MAX npm install --production --unsafe-perm --no-optional && npm cache c
|
|||||||
COPY . ./
|
COPY . ./
|
||||||
|
|
||||||
ENV INITSYSTEM on
|
ENV INITSYSTEM on
|
||||||
ENV FLOWS=flow.json
|
|
||||||
ENV NODE_PATH=/usr/src/app/node_modules
|
ENV NODE_PATH=/usr/src/app/node_modules
|
||||||
|
|
||||||
EXPOSE 1880
|
EXPOSE 1880
|
||||||
|
|
||||||
CMD ["npm", "start", "node_modules/node-red/red.js"]```
|
CMD ["npm", "start", "node_modules/node-red/red.js"]```
|
||||||
|
|
||||||
A really minimal Dockerfile to build an image 9but not run) could be as simple as
|
A really minimal Dockerfile to build an image (but not run) could be as simple as
|
||||||
|
|
||||||
```FROM node:8-onbuild
|
```FROM node:8-onbuild
|
||||||
ENV FLOWS=flow.json
|
|
||||||
VOLUME /root/.node-red
|
VOLUME /root/.node-red
|
||||||
EXPOSE 1880```
|
EXPOSE 1880```
|
Loading…
Reference in New Issue
Block a user