Maybe what you're seeing is an artifact left over from some testing/development related code? Or maybe the SQLite db is designed to work that way to better facilitate testing? Either way, it seems to me like setting up a PostgreSQL server is the intended deployment method for production use. I just did this and it is working as it should; even when restarting the Docker container.
By default, the server will use SQLite, which allows you to test the app without setting up a database. When running the server for production use, you should connect the container to a database
— joplin/packages/server/README.md at dev · laurent22/joplin · GitHub