This is an example application for the dokku-litestream plugin.
It is based on a brand new Rails 7 application, extended with a Post
scaffold and tweaks for deployment on Dokku.
You can use this simply as a reference for bringing your SQLite app onto Dokku, use it as sample app to try out the dokku-litestream plugin or even as a starting point for your next application.
# Create an app on your Dokku host
$ dokku apps:create my-litestream-rails
# Create a persistent storage directory
$ dokku storage:ensure-directory my-litestream-rails--db
# Mount the storage to your app
$ dokku storage:mount /var/lib/dokku/data/storage/my-litestream-rails--db:/app/db/litestream
git pull https://github.com/AxelTheGerman/dokku-litestream-example-rails.git
cd dokku-litestream-example-rails
git remote add dokku dokku@dokku.me:my-litestream-rails
git push dokku
Your application should be fully usable at this point - including persistent database across application restarts, deployments and in one-off dokku tasks.
But any production ready application needs database backups.
Follow the instructions over at dokku-litestream for the latest setup instruction.