A docker image is immutable. Every time you start a container the app is reset. So, you have to make sure the dynamic part is on the Host (truenas). One way is PVC and the other way is : host path mounts.
If you use the official/truechart images it is automatically managed for you. But if you use a "normal" dockerhub image you need to know/understand the volumes.
For example.
This image is storing its data in "/config", but
this image is using "/datadir". So, you have to make sure this is preserved after the restart.
Also note, IF you make a mapping it will "hide/overrule" the files of the original image. For example. I spin up a image. I have ssl based files in "/etc/ssl". Now i terminate the container and i make a truenas mapping "/mnt/tank/random_folder" -> "/etc/ssl". If i start the container all the "ssl" files are hidden and i only see the content of "random_folder" in "/etc/ssl".
So, it is easy to break stuff.
"/etc" contains important operating stuff.
It is also questionable to modify those actually. If you have to need the app in such integral/structural way you better can create your own image (based on the original one) and overrule the file(s) in the new "layer".
Practical example. sabnzbd.
Let, for example, say that you want to change a openssl setting which is not supported by the app. As we see in the repo it
installs openssl . This will also create a "/etc/" entry like "/etc/ssl/ssl.conf". You can create your own image based on this one and ONLY modify this "/etc/ssl/ssl.conf" file. This will create a new "layer" and overrule the file created by the original author.
TLDR: if you want to modify app settings use the image as intended. If you need to modify "OS" stuff you need to create you own image.