Yes, because when (not if) your container crashes, your data is gone.
At that point you can argue there is no point in using a container, but your statement is false.
If you can't guarantee that, you are going into the world of NFS (which databases do not like much) or iSCSI, or, if you have distributed storage, into the world of glusterfs, ceph or something similar.
It's much simpler to just set up a database server (or cluster) and live with that.