>The DX for deploying SQLite apps to Fly.io is rough. I'm a few hours into trying to get a production Rails app booting, but running into issues getting the database to initialize, migrate, and become writable. The root of my problem was the eager loading of a gem I wrote, but there were several layers of runners above it that made it hard to diagnose.

What's the Fly.io issue here? Aren't the issues you're describing in Rails not Fly.io?

I run several Go apps in production on Fly.io[0, 1, 2] and I've never had an issue with the Fly.io + SQLite part of it.

SQLite + Litestream makes things slightly more complicated, but again, I've never had issues with Fly.io specifically making that harder. I use a custom launch script in my Dockerfile that starts litestream with the -exec flag to start my app as a child process.[3]

[0] https://github.com/mtlynch/logpaste

[1] https://github.com/mtlynch/picoshare

[2] https://github.com/mtlynch/screenjournal

[3] https://github.com/mtlynch/logpaste/blob/0.3.1/docker-entryp...

Thx. The only problem I have with litestream binary is ~31Mb !?

This why I prefer to take backup stuff in a side container, eg: https://github.com/atrakic/gin-sqlite/blob/main/compose.yml

As a side note, you might consider revisiting your dockerfiles and skip litestream build steps, eg. in your final stage just add line like this:

COPY --from=litestream/litestream /usr/local/bin/litestream /bin/litestream

>Thx. The only problem I have with litestream binary is ~31Mb !?

Where are you seeing a 31 MB binary? Latest releases are 10-11 MB.[0]

>This why I prefer to take backup stuff in a side container, eg: https://github.com/atrakic/gin-sqlite/blob/main/compose.yml

Yeah, I agree that's cleaner, but once you're dealing with multiple containers, it's a big step up in complexity, and you can't do the simple install on places like Fly.io and Lightsail.

>As a side note, you might consider revisiting your dockerfiles and skip litestream build steps, eg. in your final stage just add line like this:

>COPY --from=litestream/litestream /usr/local/bin/litestream /bin/litestream

Ah, thanks! The litestream Docker image is new as of 0.5.0.

[0] https://github.com/benbjohnson/litestream/releases