I am busy with dockering my domotica environment.
I use the following compose-file and dockerfile to docker nodered and some dependencies
Questions i have:
-
i like to mount a usb drive to node-red to store camera-data on it during a nodered flow
How can i achive that ? -
i tried to test these commands within the nodered-container with
sudo docker exec -i -t nodered /bin/sh
But when i put commands in this container like: dir i get : command not found!
How can i make these container a little bit smarter...
compose file
version: '3.6'
services:
mysql:
container_name: mysql
image: biarms/mysql
restart: always
volumes:
- ./volumes/mysql/data:/var/lib/mysql
ports:
- '6603:3306'
environment:
MYSQL_ROOT_PASSWORD: "xxxxxx"
mosquitto:
container_name: mosquitto
image: eclipse-mosquitto
restart: unless-stopped
user: "1000"
ports:
- "1883:1883"
volumes:
- ./volumes/mosquitto/data:/mosquitto/data
- ./volumes/mosquitto/log:/mosquitto/log
- ./volumes/mosquitto/pwfile:/mosquitto/pwfile
- ./volumes/mosquitto/config:/mosquitto/config:ro
network_mode: bridge
phpmyadmin:
container_name: phpmyadmin
image: phpmyadmin:latest
restart: always
depends_on:
- mysql
ports:
- '8080:80'
environment:
PMA_HOST: mysql
nodered:
container_name: nodered
build: ./services/nodered/.
restart: unless-stopped
depends_on:
- mysql
- mosquitto
user: "0"
privileged: true
environment:
- TZ=Etc/UTC
ports:
- "1880:1880"
# - "443:443"
volumes:
- "./volumes/nodered/data:/data"
- "/var/run/docker.sock:/var/run/docker.sock"
- "/var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket"
devices:
- "/dev/gpiomem:/dev/gpiomem"
- "/dev/ttyAMA0:/dev/ttyAMA0"
- "/dev/vcio:/dev/vcio"
networks:
- iotstack_nw
logging:
options:
max-size: 5m
max-file: "3"
networks:
iotstack_nw:
name: IOTstack_Net
# external: true
driver: bridge
ipam:
driver: default
config:
- subnet: 10.77.60.0/24
dockerfile
FROM nodered/node-red:latest
USER root
# how can i mount a usb device so that flows can store data on this device
RUN apk update && apk add --no-cache eudev-dev
USER node-red
RUN cd /usr/src/node-red && npm install --save node-red-configurable-ping node-red-node-mysql node-red-dashboard node-red-node-random node-red-node-email node-red-contrib-cast node-red-contrib-castv2 node-red-contrib-fs-ops node-red-contrib-ip node-red-contrib-moment node-red-contrib-nora node-red-contrib-queue-gate node-red-contrib-repeat node-red-contrib-sonos-plus node-red-dashboard node-red-node-base64 node-red-node-email node-red-node-pushover node-red-node-ui-list node-red-node-ui-table
or paste code here