Using Litestream to Restore My Database for Easy Development
Litestream see Using Litestream to Backup QuadTask's SQLite DB for how I setup litestream replication for QuadTask I have the entrypoint to my app container check if the sqlite database exists or not - in production or with local volume mounts, it will and then we start litestream replication and then the app like normal. But what’s awesome about this little trick I got from this litestream example is I can docker compose up locally without the data directory volume mounted in, and get a fresh copy of my production data right there locally to work with! My entrypoint script now looks like: Appropriate and Safe Replication # The way to get prod data in automatically is to restore from the production backup but I don’t want to replicate to the production backup with my local work, so it’s not the best but I have a manual step that makes it pretty easy I first and this brings my database down to a folder I maintain locally. I have litestream installed on my desktop obviously, and here’s t…