Skip to content

    Joy of Rails deploys to a single VPS hosted by Digital Ocean managed by Hatchbox.io.

    Hatchbox is a great alternative to managing your own VPS deployment via Capistrano, Mina, or Kamal. There’s a YouTube video that serves as a great intro if you want to learn more.

    Hatchbox homepage
    Hatchbox homepage

    I use a Github Action on the main branch of the Joy of Rails Github repo for continuous deployment.

    I have spent very little time debugging a failed Hatchbox deployment—they rarely happen and it’s always been my fault. The Hatchbox dashboard surfaces deploy logs and Rails logs that have helped me figure out the root cause.

    Link to heading Customizing Hatchbox

    I do though need to customize Hatchbox from time-to-time. I‘ve put together this page as a reference mostly for myself for future reference.

    Sometimes I need help understanding how Hatchbox does things under-the-hood. There is an older version of Hatchbox, now called "Hatchbox Classic" that has a pretty extensive documentation site. Joy of Rails runs on the newer version of Hatchbox which doesn’t appear to have a docs site (as far as I know).

    To make up the gap, they have a help desk site and have been very responsive to my questions or I‘ve otherwise been able to find what I need there.

    Here is a collection of helpful articles from the new Hatchbox help site:

    I’ve also opened up some tickets. I think it‘s difficult to share long-lived links to these conversations since they live behind a login or temporary token. Here are some selected screenshots to conversations I‘ve had I may need to refer back to.

    To set compile-time flags for SQLite, I set an ENV variable for Bundler through the Hatchbox UI.

    Conversation about Bundler Config
    Conversation about Bundler Config

    I use Litestream Ruby for streaming backups of the Joy of Rails SQLite databases. The Litestream Ruby gem provides a Rails engine to see the current status of the Litestream process managed by systemd on Hatchbox. I had to customize the Litestream Ruby gem to wire up the Rails engine properly with Hatchbox. This even me contributing this pull request to Litestream Ruby.

    Conversation about systemd part 1
    Conversation about systemd part 1

    Conversation about systemd part 2
    Conversation about systemd part 2

    Since I know Hatchbox is a Rails app and I want to spread the joy of making Rails apps installable as Progressive Web Apps, I helped nudge making Hatchbox compatible with the new PWA features of Rails 7/8. This led to some improvements Chris Oliver contributed to Rails!

    Conversation about installing p
    Conversation about installing pwa

    I‘d recommend giving Hatchbox a try if you like the idea of using VPS like DigitalOcean and don’t want to spend time wrestling with Kamal.

    A hatchbox
    A hatchbox

    #ruby-on-rails #rails-configuration

    More articles to enjoy