Joplin Server: Mounting SQLite database in volume

I am using a joplin server (through a docker image) just for me, so I can sync my notes in my smartphone and computers (work and home computers). It works pretty well, even with SQLite as backend.

But I would like to have the database mounted in a volume, so that it survives issues with my docker containers. I tried to mount only the sqlite as a volume, but then the server fails on obtaining a lock. I suppose the best approach would be to mount the whole folder where the database is created. The problem is that, as of now, the database is created in the same folder as the server code.

This said, any idea how I can configure my docker image to achieve my goals?