CINXE.COM
SQLite & Rails in Production article - rails - Fly.io
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>SQLite & Rails in Production article - rails - Fly.io</title> <meta name="description" content="Not sure whether this is the place to do it, but I’d like to suggest a correction/update to this article: SQLite &amp; Rails in Production · The Ruby Dispatch It says after running fly launch This will create a fly.toml f&hellip;"> <meta name="generator" content="Discourse 3.4.0.beta3-dev - https://github.com/discourse/discourse version d71016522e8d9bb21c20312388271f8f0dd53069"> <link rel="icon" type="image/png" href="https://global.discourse-cdn.com/fly1/optimized/1X/276bd78a68c1a9248075881ff96190aa81ee5804_2_32x32.png"> <link rel="apple-touch-icon" type="image/png" href="https://global.discourse-cdn.com/fly1/optimized/1X/6e8955d00cb218e186ebbe3a6ab06fefdce15290_2_180x180.svg"> <meta name="theme-color" media="all" content="#3c83e7"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, user-scalable=yes, viewport-fit=cover"> <link rel="canonical" href="https://community.fly.io/t/sqlite-rails-in-production-article/20564" /> <link rel="search" type="application/opensearchdescription+xml" href="https://community.fly.io/opensearch.xml" title="Fly.io Search"> <link href="https://sea1.discourse-cdn.com/fly1/stylesheets/color_definitions_graceful_10_11_7a40646533b6c49ba7d304cff935ac98a67182f3.css?__ws=community.fly.io" media="all" rel="stylesheet" class="light-scheme"/> <link href="https://sea1.discourse-cdn.com/fly1/stylesheets/desktop_6fc0fa5be0c6005b80c3c33102ff5aa2e4e98b40.css?__ws=community.fly.io" media="all" rel="stylesheet" data-target="desktop" /> <link href="https://sea1.discourse-cdn.com/fly1/stylesheets/checklist_6fc0fa5be0c6005b80c3c33102ff5aa2e4e98b40.css?__ws=community.fly.io" media="all" rel="stylesheet" data-target="checklist" /> <link href="https://sea1.discourse-cdn.com/fly1/stylesheets/discourse-ai_6fc0fa5be0c6005b80c3c33102ff5aa2e4e98b40.css?__ws=community.fly.io" media="all" rel="stylesheet" data-target="discourse-ai" /> <link href="https://sea1.discourse-cdn.com/fly1/stylesheets/discourse-akismet_6fc0fa5be0c6005b80c3c33102ff5aa2e4e98b40.css?__ws=community.fly.io" media="all" rel="stylesheet" data-target="discourse-akismet" /> <link href="https://sea1.discourse-cdn.com/fly1/stylesheets/discourse-cakeday_6fc0fa5be0c6005b80c3c33102ff5aa2e4e98b40.css?__ws=community.fly.io" media="all" rel="stylesheet" data-target="discourse-cakeday" /> <link href="https://sea1.discourse-cdn.com/fly1/stylesheets/discourse-chat-integration_6fc0fa5be0c6005b80c3c33102ff5aa2e4e98b40.css?__ws=community.fly.io" media="all" rel="stylesheet" data-target="discourse-chat-integration" /> <link href="https://sea1.discourse-cdn.com/fly1/stylesheets/discourse-details_6fc0fa5be0c6005b80c3c33102ff5aa2e4e98b40.css?__ws=community.fly.io" media="all" rel="stylesheet" data-target="discourse-details" /> <link href="https://sea1.discourse-cdn.com/fly1/stylesheets/discourse-lazy-videos_6fc0fa5be0c6005b80c3c33102ff5aa2e4e98b40.css?__ws=community.fly.io" media="all" rel="stylesheet" data-target="discourse-lazy-videos" /> <link href="https://sea1.discourse-cdn.com/fly1/stylesheets/discourse-local-dates_6fc0fa5be0c6005b80c3c33102ff5aa2e4e98b40.css?__ws=community.fly.io" media="all" rel="stylesheet" data-target="discourse-local-dates" /> <link href="https://sea1.discourse-cdn.com/fly1/stylesheets/discourse-policy_6fc0fa5be0c6005b80c3c33102ff5aa2e4e98b40.css?__ws=community.fly.io" media="all" rel="stylesheet" data-target="discourse-policy" /> <link href="https://sea1.discourse-cdn.com/fly1/stylesheets/discourse-presence_6fc0fa5be0c6005b80c3c33102ff5aa2e4e98b40.css?__ws=community.fly.io" media="all" rel="stylesheet" data-target="discourse-presence" /> <link href="https://sea1.discourse-cdn.com/fly1/stylesheets/discourse-solved_6fc0fa5be0c6005b80c3c33102ff5aa2e4e98b40.css?__ws=community.fly.io" media="all" rel="stylesheet" data-target="discourse-solved" /> <link href="https://sea1.discourse-cdn.com/fly1/stylesheets/discourse-templates_6fc0fa5be0c6005b80c3c33102ff5aa2e4e98b40.css?__ws=community.fly.io" media="all" rel="stylesheet" data-target="discourse-templates" /> <link href="https://sea1.discourse-cdn.com/fly1/stylesheets/discourse-topic-voting_6fc0fa5be0c6005b80c3c33102ff5aa2e4e98b40.css?__ws=community.fly.io" media="all" rel="stylesheet" data-target="discourse-topic-voting" /> <link href="https://sea1.discourse-cdn.com/fly1/stylesheets/footnote_6fc0fa5be0c6005b80c3c33102ff5aa2e4e98b40.css?__ws=community.fly.io" media="all" rel="stylesheet" data-target="footnote" /> <link href="https://sea1.discourse-cdn.com/fly1/stylesheets/hosted-site_6fc0fa5be0c6005b80c3c33102ff5aa2e4e98b40.css?__ws=community.fly.io" media="all" rel="stylesheet" data-target="hosted-site" /> <link href="https://sea1.discourse-cdn.com/fly1/stylesheets/poll_6fc0fa5be0c6005b80c3c33102ff5aa2e4e98b40.css?__ws=community.fly.io" media="all" rel="stylesheet" data-target="poll" /> <link href="https://sea1.discourse-cdn.com/fly1/stylesheets/spoiler-alert_6fc0fa5be0c6005b80c3c33102ff5aa2e4e98b40.css?__ws=community.fly.io" media="all" rel="stylesheet" data-target="spoiler-alert" /> <link href="https://sea1.discourse-cdn.com/fly1/stylesheets/discourse-ai_desktop_6fc0fa5be0c6005b80c3c33102ff5aa2e4e98b40.css?__ws=community.fly.io" media="all" rel="stylesheet" data-target="discourse-ai_desktop" /> <link href="https://sea1.discourse-cdn.com/fly1/stylesheets/discourse-topic-voting_desktop_6fc0fa5be0c6005b80c3c33102ff5aa2e4e98b40.css?__ws=community.fly.io" media="all" rel="stylesheet" data-target="discourse-topic-voting_desktop" /> <link href="https://sea1.discourse-cdn.com/fly1/stylesheets/poll_desktop_6fc0fa5be0c6005b80c3c33102ff5aa2e4e98b40.css?__ws=community.fly.io" media="all" rel="stylesheet" data-target="poll_desktop" /> <link href="https://sea1.discourse-cdn.com/fly1/stylesheets/desktop_theme_11_830c6ccc8eef42da7ee7392013202b0802039f33.css?__ws=community.fly.io" media="all" rel="stylesheet" data-target="desktop_theme" data-theme-id="11" data-theme-name="graceful"/> <script src="https://status.flyio.net/embed/script.js" defer="" nonce="5MCLyDB2avN7Vqi7RFuoPtFyc"></script> <script defer="" data-domain="community.fly.io" src="https://plausible.io/js/script.hash.js" nonce="5MCLyDB2avN7Vqi7RFuoPtFyc"></script> <link rel="alternate nofollow" type="application/rss+xml" title="RSS feed of 'SQLite & Rails in Production article'" href="https://community.fly.io/t/sqlite-rails-in-production-article/20564.rss" /> <meta property="og:site_name" content="Fly.io" /> <meta property="og:type" content="website" /> <meta name="twitter:card" content="summary_large_image" /> <meta name="twitter:image" content="https://global.discourse-cdn.com/fly1/original/3X/d/f/df182ca52467742d389d4af72b63e05802bf38d8.jpeg" /> <meta property="og:image" content="https://global.discourse-cdn.com/fly1/original/3X/6/e/6e8955d00cb218e186ebbe3a6ab06fefdce15290.svg" /> <meta property="og:url" content="https://community.fly.io/t/sqlite-rails-in-production-article/20564" /> <meta name="twitter:url" content="https://community.fly.io/t/sqlite-rails-in-production-article/20564" /> <meta property="og:title" content="SQLite & Rails in Production article" /> <meta name="twitter:title" content="SQLite & Rails in Production article" /> <meta property="og:description" content="Not sure whether this is the place to do it, but I’d like to suggest a correction/update to this article: SQLite & Rails in Production · The Ruby Dispatch It says after running fly launch This will create a fly.toml file in your project working directory environment, and provision resources on Fly.io. A Dockerfile is also generated, which is a description of the server that will be running in production. You should see a LITESTACK_DATA_PATH environment in your Dockerfile that points to /da..." /> <meta name="twitter:description" content="Not sure whether this is the place to do it, but I’d like to suggest a correction/update to this article: SQLite & Rails in Production · The Ruby Dispatch It says after running fly launch This will create a fly.toml file in your project working directory environment, and provision resources on Fly.io. A Dockerfile is also generated, which is a description of the server that will be running in production. You should see a LITESTACK_DATA_PATH environment in your Dockerfile that points to /da..." /> <meta property="og:article:tag" content="rails" /> <meta property="og:article:tag" content="sqlite" /> <meta name="twitter:label1" value="Reading time" /> <meta name="twitter:data1" value="1 mins 🕑" /> <meta name="twitter:label2" value="Likes" /> <meta name="twitter:data2" value="1 ❤" /> <meta property="article:published_time" content="2024-06-26T12:36:09+00:00" /> <meta property="og:ignore_canonical" content="true" /> <script type="application/ld+json">{"@context":"http://schema.org","@type":"QAPage","name":"SQLite & Rails in Production article","mainEntity":{"@type":"Question","name":"SQLite & Rails in Production article","text":"Not sure whether this is the place to do it, but I’d like to suggest a correction/update to this article: <a href=\"https://fly.io/ruby-dispatch/sqlite-and-rails-in-production/\" class=\"inline-onebox\">SQLite & Rails in Production · The Ruby Dispatch<\/a>\n\nIt says after running fly launch\n\nThis will create a fly.toml file in your project working directory environment, and provision resources on <a href=\"http://Fly.io\" rel=\"noopener nofollow ugc\">Fl…<\/a>","upvoteCount":1,"answerCount":0,"datePublished":"2024-06-26T12:36:09.847Z","author":{"@type":"Person","name":"Youdaman","url":"https://community.fly.io/u/Youdaman"}}}</script> </head> <body class="crawler browser-update"> <div class="background-container"></div> <header> <a href="/"> Fly.io </a> </header> <div id="main-outlet" class="wrap" role="main"> <div id="topic-title"> <h1> <a href="/t/sqlite-rails-in-production-article/20564">SQLite & Rails in Production article</a> </h1> <div class="topic-category"> <div class='discourse-tags list-tags'> <a href='https://community.fly.io/tag/rails' class='discourse-tag' rel="tag">rails</a>, <a href='https://community.fly.io/tag/sqlite' class='discourse-tag' rel="tag">sqlite</a> </div> </div> </div> <div itemscope itemtype='http://schema.org/DiscussionForumPosting'> <meta itemprop='headline' content='SQLite & Rails in Production article'> <link itemprop='url' href='https://community.fly.io/t/sqlite-rails-in-production-article/20564'> <meta itemprop='datePublished' content='2024-06-26T12:36:09Z'> <meta itemprop='articleSection' content='General'> <meta itemprop='keywords' content='rails, sqlite'> <div itemprop='publisher' itemscope itemtype="http://schema.org/Organization"> <meta itemprop='name' content='Fly.io'> <div itemprop='logo' itemscope itemtype="http://schema.org/ImageObject"> <meta itemprop='url' content='https://global.discourse-cdn.com/fly1/original/3X/4/9/49b670bceec1e465f38edfcb9223f572edcbe900.svg'> </div> </div> <div id='post_1' class='topic-body crawler-post'> <div class='crawler-post-meta'> <span class="creator" itemprop="author" itemscope itemtype="http://schema.org/Person"> <a itemprop="url" href='https://community.fly.io/u/Youdaman'><span itemprop='name'>Youdaman</span></a> </span> <link itemprop="mainEntityOfPage" href="https://community.fly.io/t/sqlite-rails-in-production-article/20564"> <span class="crawler-post-infos"> <time datetime='2024-06-26T12:36:09Z' class='post-time'> June 26, 2024, 12:36pm </time> <meta itemprop='dateModified' content='2024-07-05T00:45:21Z'> <span itemprop='position'>1</span> </span> </div> <div class='post' itemprop='text'> <p>Not sure whether this is the place to do it, but I’d like to suggest a correction/update to this article: <a href="https://fly.io/ruby-dispatch/sqlite-and-rails-in-production/" class="inline-onebox">SQLite & Rails in Production · The Ruby Dispatch</a></p> <p>It says after running <code>fly launch</code></p> <blockquote> <p>This will create a <code>fly.toml</code> file in your project working directory environment, and provision resources on <a href="http://Fly.io" rel="noopener nofollow ugc">Fly.io</a>. A <code>Dockerfile</code> is also generated, which is a description of the server that will be running in production.</p> </blockquote> <blockquote> <p>You should see a <code>LITESTACK_DATA_PATH</code> environment in your <code>Dockerfile</code> that points to <code>/data</code>. Litestack uses this path to know which folder to save SQLite databases for caching, job processing, and ActionCable.</p> </blockquote> <p>Much later in the article it says:</p> <blockquote> <p>When the <code>fly launch</code> command is run, <a href="http://Fly.io" rel="noopener nofollow ugc">Fly.io</a> runs the <a href="https://github.com/fly-apps/dockerfile-rails" rel="noopener nofollow ugc">dockerfile-rails gem</a>, which detects the Litestack gem and configures the <code>Dockerfile</code> with the <code>VOLUME</code> and <code>ENV</code> directives needed to store and access SQLite databases on persistent volume.</p> </blockquote> <p>The problem is if you have a fresh Rails app of your own and you don’t have that dockerfile-rails gem installed, you might end up going down the rabbit hole like I did of reading up about creating your own volumes etc when the gem sets up the scripts to do all that for you.</p> <p>Otherwise great article and the reason I started using <a href="http://Fly.io" rel="noopener nofollow ugc">Fly.io</a> in the first place <img src="https://emoji.discourse-cdn.com/twitter/smiley.png?v=12" title=":smiley:" class="emoji" alt=":smiley:" loading="lazy" width="20" height="20"></p> <p>cc <a class="mention" href="/u/brad">@Brad</a></p> </div> <div itemprop="interactionStatistic" itemscope itemtype="http://schema.org/InteractionCounter"> <meta itemprop="interactionType" content="http://schema.org/LikeAction"/> <meta itemprop="userInteractionCount" content="1" /> <span class='post-likes'>1 Like</span> </div> </div> <div id='post_2' itemprop='comment' itemscope itemtype='http://schema.org/Comment' class='topic-body crawler-post'> <div class='crawler-post-meta'> <span class="creator" itemprop="author" itemscope itemtype="http://schema.org/Person"> <a itemprop="url" href='https://community.fly.io/u/system'><span itemprop='name'>system</span></a> Closed </span> <span class="crawler-post-infos"> <time itemprop='datePublished' datetime='2024-07-03T12:36:44Z' class='post-time'> July 3, 2024, 12:36pm </time> <meta itemprop='dateModified' content='2024-07-03T12:36:44Z'> <span itemprop='position'>2</span> </span> </div> <div class='post' itemprop='text'> <p>This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.</p> </div> <div itemprop="interactionStatistic" itemscope itemtype="http://schema.org/InteractionCounter"> <meta itemprop="interactionType" content="http://schema.org/LikeAction"/> <meta itemprop="userInteractionCount" content="0" /> <span class='post-likes'></span> </div> </div> </div> <div id="related-topics" class="more-topics__list " role="complementary" aria-labelledby="related-topics-title"> <h3 id="related-topics-title" class="more-topics__list-title"> Related topics </h3> <div class="topic-list-container" itemscope itemtype='http://schema.org/ItemList'> <meta itemprop='itemListOrder' content='http://schema.org/ItemListOrderDescending'> <table class='topic-list'> <thead> <tr> <th>Topic</th> <th></th> <th class="replies">Replies</th> <th class="views">Views</th> <th>Activity</th> </tr> </thead> <tbody> <tr class="topic-list-item" id="topic-list-item-16431"> <td class="main-link" itemprop='itemListElement' itemscope itemtype='http://schema.org/ListItem'> <meta itemprop='position' content='1'> <span class="link-top-line"> <a itemprop='url' href='https://community.fly.io/t/litestack-problems-with-deployment/16431' class='title raw-link raw-topic-link'>Litestack problems with deployment</a> </span> <div class="link-bottom-line"> <a href='/c/questions-and-help/build-debugging/12' class='badge-wrapper bullet'> <span class='badge-category-bg' style='background-color: #92278F'></span> <span class='badge-category clear-badge'> <span class='category-name'>Build debugging</span> </span> </a> <div class="discourse-tags"> <a href='https://community.fly.io/tag/sqlite' class='discourse-tag'>sqlite</a> </div> </div> </td> <td class="replies"> <span class='posts' title='posts'>5</span> </td> <td class="views"> <span class='views' title='views'>529</span> </td> <td> January 11, 2024 </td> </tr> <tr class="topic-list-item" id="topic-list-item-22787"> <td class="main-link" itemprop='itemListElement' itemscope itemtype='http://schema.org/ListItem'> <meta itemprop='position' content='2'> <span class="link-top-line"> <a itemprop='url' href='https://community.fly.io/t/rails-app-change-postgres-db-to-sqlite3-using-litestack/22787' class='title raw-link raw-topic-link'>Rails app change postgres db to sqlite3 using litestack</a> </span> <div class="link-bottom-line"> <a href='/c/questions-and-help/build-debugging/12' class='badge-wrapper bullet'> <span class='badge-category-bg' style='background-color: #92278F'></span> <span class='badge-category clear-badge'> <span class='category-name'>Build debugging</span> </span> </a> <div class="discourse-tags"> <a href='https://community.fly.io/tag/rails' class='discourse-tag'>rails</a> , <a href='https://community.fly.io/tag/sqlite' class='discourse-tag'>sqlite</a> , <a href='https://community.fly.io/tag/volumes' class='discourse-tag'>volumes</a> </div> </div> </td> <td class="replies"> <span class='posts' title='posts'>17</span> </td> <td class="views"> <span class='views' title='views'>83</span> </td> <td> November 28, 2024 </td> </tr> <tr class="topic-list-item" id="topic-list-item-21449"> <td class="main-link" itemprop='itemListElement' itemscope itemtype='http://schema.org/ListItem'> <meta itemprop='position' content='3'> <span class="link-top-line"> <a itemprop='url' href='https://community.fly.io/t/production-data-different-than-data-in-fly-console/21449' class='title raw-link raw-topic-link'>Production data different than data in fly console</a> </span> <div class="link-bottom-line"> <div class="discourse-tags"> <a href='https://community.fly.io/tag/rails' class='discourse-tag'>rails</a> , <a href='https://community.fly.io/tag/sqlite' class='discourse-tag'>sqlite</a> , <a href='https://community.fly.io/tag/storage' class='discourse-tag'>storage</a> </div> </div> </td> <td class="replies"> <span class='posts' title='posts'>3</span> </td> <td class="views"> <span class='views' title='views'>35</span> </td> <td> August 28, 2024 </td> </tr> <tr class="topic-list-item" id="topic-list-item-8568"> <td class="main-link" itemprop='itemListElement' itemscope itemtype='http://schema.org/ListItem'> <meta itemprop='position' content='4'> <span class="link-top-line"> <a itemprop='url' href='https://community.fly.io/t/are-rails-deployments-in-fly-io-considered-development-or-production-environments-problems-with-sqlite3/8568' class='title raw-link raw-topic-link'>Are Rails deployments in fly.io considered Development or Production environments? Problems with sqlite3</a> </span> <div class="link-bottom-line"> <a href='/c/questions-and-help/11' class='badge-wrapper bullet'> <span class='badge-category-bg' style='background-color: #0088CC'></span> <span class='badge-category clear-badge'> <span class='category-name'>Questions / Help</span> </span> </a> <div class="discourse-tags"> <a href='https://community.fly.io/tag/postgres' class='discourse-tag'>postgres</a> , <a href='https://community.fly.io/tag/rails' class='discourse-tag'>rails</a> </div> </div> </td> <td class="replies"> <span class='posts' title='posts'>8</span> </td> <td class="views"> <span class='views' title='views'>725</span> </td> <td> November 11, 2022 </td> </tr> <tr class="topic-list-item" id="topic-list-item-16434"> <td class="main-link" itemprop='itemListElement' itemscope itemtype='http://schema.org/ListItem'> <meta itemprop='position' content='5'> <span class="link-top-line"> <a itemprop='url' href='https://community.fly.io/t/failing-to-deploy-after-generating-new-dockerfile-for-upgraded-rails-7-1-2-app/16434' class='title raw-link raw-topic-link'>Failing to deploy after generating new Dockerfile for upgraded Rails 7.1.2 app</a> </span> <div class="link-bottom-line"> <a href='/c/questions-and-help/11' class='badge-wrapper bullet'> <span class='badge-category-bg' style='background-color: #0088CC'></span> <span class='badge-category clear-badge'> <span class='category-name'>Questions / Help</span> </span> </a> <div class="discourse-tags"> <a href='https://community.fly.io/tag/rails' class='discourse-tag'>rails</a> </div> </div> </td> <td class="replies"> <span class='posts' title='posts'>10</span> </td> <td class="views"> <span class='views' title='views'>768</span> </td> <td> November 20, 2023 </td> </tr> </tbody> </table> </div> </div> </div> <footer class="container wrap"> <nav class='crawler-nav'> <ul> <li itemscope itemtype='http://schema.org/SiteNavigationElement'> <span itemprop='name'> <a href='/' itemprop="url">Home </a> </span> </li> <li itemscope itemtype='http://schema.org/SiteNavigationElement'> <span itemprop='name'> <a href='/categories' itemprop="url">Categories </a> </span> </li> <li itemscope itemtype='http://schema.org/SiteNavigationElement'> <span itemprop='name'> <a href='/guidelines' itemprop="url">Guidelines </a> </span> </li> <li itemscope itemtype='http://schema.org/SiteNavigationElement'> <span itemprop='name'> <a href='/tos' itemprop="url">Terms of Service </a> </span> </li> <li itemscope itemtype='http://schema.org/SiteNavigationElement'> <span itemprop='name'> <a href='/privacy' itemprop="url">Privacy Policy </a> </span> </li> </ul> </nav> <p class='powered-by-link'>Powered by <a href="https://www.discourse.org">Discourse</a>, best viewed with JavaScript enabled</p> </footer> <div class="buorg"><div>Unfortunately, <a href="https://www.discourse.org/faq/#browser">your browser is unsupported</a>. Please <a href="https://browsehappy.com">switch to a supported browser</a> to view rich content, log in and reply.</div></div> </body> </html>