Docker container resets every time hardware is restarted

been using rhasspy via docker without any issues. i’ve created new wav files for the wake and recorded sounds, and moved them to appropriate folder in the docker container. problem is that i’ve noticed that when i restart the hardware, those files are removed and i have to again move them into the docker container.

is this just an issue working with containers and i need to automate moving the files every time i restart, or is there some other issue i’m missing?

I think the better way to do it is to mount a directory from the host and just put the files there.
The docker run config is like this

docker run -d -p 12101:12101 \
      --name rhasspy \
      --restart unless-stopped \
      -v "$HOME/.config/rhasspy/profiles:/profiles" \
      -v "/etc/localtime:/etc/localtime:ro" \
      --device /dev/snd:/dev/snd \
      rhasspy/rhasspy \
      --user-profiles /profiles \
      --profile en

https://rhasspy.readthedocs.io/en/latest/installation/

When rhasspy runs it does this with

      -v "$HOME/.config/rhasspy/profiles:/profiles" \
      -v "/etc/localtime:/etc/localtime:ro" \

Which mounts the host “$HOME/.config/rhasspy/profiles” to “/profiles”
and
“/etc/localtime” to “/etc/localtime” as readonly hence the :ro

So prob create a folder copy what you need there and add to the docker run config in the same format.

-v [volume I think] “[my host folder]:[my docker folder]” \

that makes sense to me, but i’m seraching for the /rhasspy/profiles directory and not finding it. could it be something else?

@synesthesiam Will have to defer as with docker being ephemeral the above is prob correct but haven’t had a working setup of Rhasspy for so long I tend to forget.

What is the command you start the container with?

$HOME/.config/rhasspy/profiles the . infront of config makes it hidden.
ls -a shows hidden files, $HOME is a variable likely /home/pi/

PS also you could do it your way and do a docker commit to create a new image from a running container but updates and stuff will likely not be pushed.

You don’t have to use the profiles dir as you can just add another volume with another -v line

i thought i was running this from a docker command, but i guess i was running rhasspy via the homeassistant addon. meaning i have no idea what command it is using to start the container, and no idea where it is mounting ‘profiles’ from.

back to the drawing board

Prob a @synesthesiam as likely will know as same as not done a lot with home assistant but presume it is just a docker container and there are some run files or yaml config to create a run file or something.

See if the @ provides any further info.

yup makes sense. your solution seems like it should be the correct fix, it’s just a bit of a black box i need to figure out.

Then your profiles folder will be in the /share/rhasspy folder of the HA instance.
So if you use:

${RHASSPY_PROFILE_DIR}/sounds/wake.wav

in the Wake WAV setting, that will map to

/share/rhasspy/profiles/<yourlanguage>/sounds/wake.wav

I have that as well.

You can easily access the /share folder if you install the Samba Addon