Nextcloud Settings reset after restart

So this may have been covered in the past and I also may have over looked something simple but the problem I am having is I installed nextcloud. I go into the container for nextcloud and install the Samba support and nfs common and get the remote folders working. Then if I do an update or stop the app from running then restart it everything I have done there is gone and I have to do it all over again. The settings in nextcloud are still there for the remote drives but the software I installed inside the container is no longer there.

Ontop of that I would like to get the https working with it as well. I would rather install it here in the truenas server rather than go put it on my web server and do things that way because the truenas server has a disk array attached to it and most of the local storage is there. I then have some other drives I mount through a VPN on another server in another location. How do I make the settings stick and then what do I do next to enable the https support?
Even just pointing me in the right direction to some useful instructions would be greatly appreciated.

With a container, settings held inside the container are epherimal - they get deleted if you stop the container. You need to map the “config” folder (which can differ) to a permanent place of residence on the NAS