I have two questions which are related but which I’ll keep separate for clarity:
Question 1:
My current docker-compose.yml looks like this:
services:
rhasspy:
image: rhasspy/rhasspy
container_name: rhasspy
restart: always
volumes:
- /home/pi/containers/rhasspy/profiles:/profiles
ports:
- 12101:12101
devices:
- /dev/snd:/dev/snd
command: --user-profiles /profiles --profile nl
node-red:
image: nodered/node-red
container_name: node-red
restart: always
volumes:
- ./node-red:/data
ports:
- 1880:1880
- 1883:1883
environment:
- TZ=Europe/Brussels
As I want to follow the instructions from the “Control Your Home with Raspberry Pi”-book closer.
I’d like to replace (after a mkdir /home/pi/containers/node-red ) this part:
volumes:
- ./node-red:/data
by this:
volumes:
- ./containers/node-red:/data
- ./containers/certificates:/etc/ssl/private:ro
- /etc/localtime:/etc/localtime:ro
So far so good. My question now is how can I make my system take over the changed configuration without screwing the whole docker-thing. Just doing the following is probably not the right way:
docker-compose down -d
docker-compose pull
docker-compose up -d
Question 2:
Suppose I want to add a part for mosquitto in docker-compose.yml
Should the complete file then look like this:
version: '3.7'
services:
rhasspy:
image: rhasspy/rhasspy
container_name: rhasspy
restart: always
volumes:
- /home/pi/containers/rhasspy/profiles:/profiles
ports:
- 12101:12101
devices:
- /dev/snd:/dev/snd
command: --user-profiles /profiles --profile nl
node-red:
image: nodered/node-red
container_name: node-red
restart: always
volumes:
- ./containers/node-red:/data
- ./containers/certificates:/etc/ssl/private:ro
- /etc/localtime:/etc/localtime:ro
ports:
- 1880:1880
- 1883:1883
environment:
- TZ=Europe/Brussels
mosquitto:
image: eclipse-mosquitto
container_name: mosquitto
restart: always
ports:
- "1883:1883"
- "9001:9001"
volumes:
- ./containers/mosquitto/config:/mosquitto/config
- ./containers/mosquitto/data:/mosquitto/data
- ./containers/mosquitto/log:/mosquitto/log
- /etc/localtime:/etc/localtime:ro
user: "1000:1000"
Which docker-compose commands should I use then to perform the update properly?
kind regards,
hugo