How to connect to my SQLite db on fly.io?

I just went through Remix tutorial to create a web app and deploy it to fly.io. Now, how do I connect to my SQLite DB in production?

I usually use Prisma Studio. In my .env file, I got DATABASE_URL="file:./dev.db".

Is there a way to get my production DB URL and connect to it instead?

You can set your DATABASE_URL right in your Dockerfile. Example:

Note that this example puts the dockerfile on a volume rather than the current directory so that the database will survive restarts. To allocate a volume, add mount information to your fly.toml and redeploy:

If what you are asking is how you can get your production db uploaded, you can use fly sftp shell.

From How To to Questions / Help

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.