High Leverage Rails
Introduction
Introduction to this course
Why use Ruby on Rails
Why use SQLite
Ruby on Rails + SQLite
Powering Your App with SQLite
Creating tables
Timestamps
Column types
Typeof
Ruby types
Creating table introduction
Creating table advanced
Inserting data
Updating data
Upserting data
Reading data
Virtual columns
Enums
Introduction to JSON
Indexing JSON
JSON table functions
Building a Modern Rails Application
Creating a new Rails application
Installing Solid Queue
Installing Solid Cache
Installing Solid Cable
Dockerfile
Application overview
Authentication
Base styles
Registration
Scaffolding posts
Polishing posts
Scaffolding comments
Polishing comments
Polishing models
Polishing controllers
Creating new post
Updating post
Reviewing MVP
Tagging posts
Custom tags
Friendly URLs
Full text search
Deploying & Operating Your App
Backups
Check Litestream locally
Verifying backups
Deployment options
Deploying with Hatchbox
Deployment constraints
Vertical scaling
Database access
Migrations
Locked video

Please purchase the course to watch this video.

Video thumbnail
Building a Modern Rails Application
Dockerfile

Full Course

$
129
$179
USD, one-time fee
This course came at the perfect time. I’ve recently gotten back into Rails after an 18-year hiatus, and this was a perfect refresher and shows just how much you can accomplish with Rails right out of the box.
Garrett Winder
Garrett Winder

Rails hosting made simple

Deploy apps to servers that you own and control.

Move fast and fix things

Application monitoring that helps developers get it done.

Summary

Explore Rails 8’s production-ready Dockerfile with multi-stage builds and Thruster for optimized performance, including HTTP/2 support. Learn how to apply these improvements when deploying outside Docker and compare Rails’ new Kamal deployment tool with Hatchbox for fast, efficient app deployment.

Links

Kamal Documentation
Hatchbox

Video Transcript

In addition to the Solid gems, another important update in Rails 8 is the handcrafted Dockerfile designed specifically for production deployments.

Understanding the Rails 8 Production Dockerfile

This Dockerfile is optimized for production, not development. If you want to use containerized development environments, Rails offers extensive support for Dev Containers, which you can explore through the link provided.

There's a lot happening in this Dockerfile, but I want to highlight a few key details:

Multi-Stage Build for a Smaller Image Size

  • This approach minimizes the final Docker image, ensuring efficient performance and faster deployments.
  • You can see the final stage implementation, which sets up the app image efficiently.

Optimized Entry Point & HTTP/2 Support

  • At the end of the Dockerfile, we have an entry point script that ensures the database is properly prepared before launching the Rails server.
  • The server runs with the bin/thrust command, using a new dependency called Thruster.
  • Thruster optimizes Rails for serving static assets, handling HTTP/2 requests, and improving overall performance.

Why This Matters for Non-Docker Deployments

If you don’t use this Dockerfile for deployment—such as when deploying to Hatchbox or other platforms—you need to replicate these optimizations manually. Ensuring that:

  1. Static assets are efficiently served.
  2. Database migrations run automatically.
  3. HTTP/2 support is enabled for better performance.

Rails 8 Deployment: Kamal vs. Hatchbox

This Dockerfile is designed to work with Kamal, the new built-in Rails deployment tool.

  • Kamal automates Rails deployments and is deeply integrated into Rails 8.
  • If you want to learn more about Kamal, there are blogs, books, and guides linked below.

Personally, I don’t use Kamal because:

  • It’s still new, and I prefer something more battle-tested.
  • I want a simple deployment process that just works.
  • I don’t want to learn extra tooling—I want to focus on building the app.

Instead, I prefer using Hatchbox, a straightforward deployment service that makes it easy to ship Rails apps to production without extra complexity.

That being said, Kamal is worth exploring, and I may revisit it in the future. If you’re looking for a fast, reliable way to deploy Rails 8 apps, Hatchbox remains my go-to solution.

Now that we’ve covered Docker, Kamal, and deployment considerations, it’s time to dive into building our Rails 8 application.