# NodeRED Docker documentation

**URL:** <https://discourse.nodered.org/t/nodered-docker-documentation/44216>\
**Category:** General\
**Created:** [15 April 2021 07:43 UTC](https://discourse.nodered.org/t/nodered-docker-documentation/44216 "2021-04-15T07:43:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kib](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kib/32/27493_2.png) [@Kib](https://discourse.nodered.org/u/Kib)\
**Post date:** [15 April 2021 07:43 UTC](https://discourse.nodered.org/t/nodered-docker-documentation/44216/1 "2021-04-15T07:43:26Z")

</div>

Docker page i am referring to : [Running under Docker : Node-RED](https://nodered.org/docs/getting-started/docker)

Hello, in the section "Dockerfile which copies in local resources" the following docker file is mentioned

```auto
FROM nodered/node-red

# Copy package.json to the WORKDIR so npm builds all
# of your added nodes modules for Node-RED
COPY package.json .
RUN npm install --unsafe-perm --no-update-notifier --no-fund --only=production

# Copy _your_ Node-RED project files into place
# NOTE: This will only work if you DO NOT later mount /data as an external volume.
# If you need to use an external volume for persistence then
# copy your settings and flows files to that volume instead.
COPY settings.js /data/settings.js
COPY flows_cred.json /data/flows_cred.json
COPY flows.json /data/flows.json

# You should add extra nodes via your package.json file but you can also add them here:
#WORKDIR /usr/src/node-red
#RUN npm install node-red-node-smooth

```

The image built with the file above will fail to start a container with `docker run`, because the `COPY package.json .` line copies **any** `package.json` from in the `pwd` but the file might not contain the `npm start` script which is the default `CMD` upon start for a `node` based docker container. (I think, i might be wrong)

However, the `custom-docker` directoy in the [node-red-docker](https://github.com/node-red/node-red-docker/tree/master/docker-custom) repository has a `package.json` which does contain these scripts like described below.

```auto
"scripts": {
        "start": "node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS",
        "debug": "node --inspect=0.0.0.0:9229 $NODE_OPTIONS node_modules/node-red/red.js $FLOWS",
        "debug_brk": "node --inspect=0.0.0.0:9229 --inspect-brk $NODE_OPTIONS node_modules/node-red/red.js $FLOWS"
    }

```

So it would be better if we added this in the documentation or made this point clear.  
Also i observed the page assumes some docker knowledge on the reader which in itself is not incorrect but some things might be made more clear as node-red is used more relatively by enthusiasts.

🙂@knolleary

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [15 April 2021 10:27 UTC](https://discourse.nodered.org/t/nodered-docker-documentation/44216/2 "2021-04-15T10:27:04Z")

</div>

Thanks - will add a note to this effect.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [14 June 2021 10:27 UTC](https://discourse.nodered.org/t/nodered-docker-documentation/44216/3 "2021-06-14T10:27:08Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
