I hope this is an easy one. I'm using Docker to run Homeassistant and Node-Red containers on a Raspberry Pi 4.
Based on this guide they recommend making a DockerFile to install Node-Red nodes to support Homeassistant. The install is handled via the npm
command within the Node-Red container.
I created both docker-compose.yaml
and Dockerfile
in a directory (file contents below).
To boot the container I use the command docker-compose up
in the directory where the docker-compose.yaml
file lives. I also made a systemd service that does the same thing without any issues.
My issue is that the DockerFile
doesn't get processed when I run docker-compose up
Is there a way to have docker-compose
pick up changes to DockerFile
every time the container is started/restarted?
[docker-compose.yaml]
version: "3.6"
services:
node-red:
build: .
container_name: node-red
environment:
TZ: /etc/localtime
image: nodered/node-red
restart: unless-stopped
ports:
- "1880:1880"
volumes:
- "/[folders]/node-red/data:/data"
[DockerFile]
FROM nodered/node-red
RUN npm install node-red-contrib-actionflows \
# https://flows.nodered.org/node/node-red-contrib-actionflows
node-red-contrib-home-assistant-websocket \
# https://flows.nodered.org/node/node-red-contrib-home-assistant-websocket
node-red-contrib-stoptimer \
# https://flows.nodered.org/node/node-red-contrib-stoptimer
node-red-contrib-time-range-switch \
# A simple Node-RED node that routes messages depending on the time. If the current time falls within the range specified in the node configuration, the message is routed to output 1. Otherwise the message is routed to output 2.
node-red-contrib-timecheck \
# Is it that time yet? This node compares a given time to the current time.
node-red-node-timeswitch
# node to provide a simple timeswitch node to schedule daily on/off events