kamal-docker-production

Configure multi-stage Docker and Kamal 2 deployments for Rails 8 production.

21|2|Updated May 24, 2026
One-click install
npx skills add https://github.com/sandeepmvl/rails-skills --skill kamal-docker-production
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kamal-docker-production
Source: https://github.com/sandeepmvl/rails-skills/tree/main/skills/09-kamal-docker-production
Command: npx skills add https://github.com/sandeepmvl/rails-skills --skill kamal-docker-production

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes assets (resource) components.

What problem does it solve?

AI coding agents generate broken, bloated, or insecure production Docker and Kamal deployment configurations for Ruby on Rails 8 apps, leading to failed deploys, leaked secrets, and wasted engineering time troubleshooting avoidable infrastructure issues.

Core Features & Use Cases

  • Opinionated multi-stage Docker setup: Uses ruby:3.x-slim base images to avoid native gem compilation failures with nokogiri, pg, and sassc, cutting image size by ~400MB compared to single-stage builds.
  • Zero-downtime Kamal 2 deployment: Pre-configured deploy.yml with Kamal Proxy health checks, proper migration execution hooks, and Solid Queue worker support.
  • Secure secrets management: Layered approach using Rails credentials, Kamal env secrets, and runtime env vars to avoid credential leaks in images or logs.
  • Use Case: A team shipping a Rails 8 app to production without Kubernetes or Heroku markup can use this skill to generate a production-ready Dockerfile and Kamal config in minutes, avoiding common infra pitfalls that waste hours of debugging.

Quick Start

Use the kamal-docker-production skill to generate a production-ready multi-stage Dockerfile and Kamal 2 deploy configuration for your Rails 8 application, following best practices for image size, zero-downtime deploys, and secure secrets management.

Frequently Asked Questions about kamal-docker-production

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I deploy a Rails 8 application to production with Kamal and Docker?

To deploy a Rails 8 application with Kamal and Docker, use this skill to generate a production-ready multi-stage Dockerfile and Kamal 2 deploy configuration. It sets up zero-downtime Kamal Proxy health checks, proper migration hooks, and layered secrets management to prevent credential leaks.

Why do my Rails Docker images fail to compile native gems like nokogiri and pg?

Rails Docker images fail compiling native gems when using bulky or mismatched base images. This skill solves it by enforcing multi-stage Docker builds with the ruby:3.x-slim base image, which prevents native gem compilation failures for nokogiri, pg, and sassc while cutting image size by roughly 400MB.

What is the best way to manage Rails secrets during Kamal production deployments?

The best way to manage Rails secrets during Kamal deployments is a layered approach using Rails credentials, Kamal env secrets, and runtime environment variables. This strategy ensures credentials are never accidentally leaked inside Docker images or exposed in deployment logs.

How do you run Rails database migrations during a zero-downtime Kamal deploy?

Running Rails database migrations during a zero-downtime Kamal deploy requires specific migration execution hooks to prevent race conditions. This skill configures Kamal 2 deployment settings to execute non-racey migrations safely alongside Kamal Proxy health checks.

Does Kamal 2 work with Solid Queue for Rails production background jobs?

Yes, Kamal 2 works with Solid Queue for Rails production background jobs. This skill provides pre-configured deploy.yml settings that include native Solid Queue worker support alongside zero-downtime deployment configurations.

What causes broken or insecure Docker configurations when AI agents generate Rails deployment files?

Broken or insecure Docker configurations occur when AI agents generate bloated single-stage builds, leak credentials in images, or misconfigure health checks. This skill eliminates those issues by enforcing opinionated multi-stage Docker setups and secure layered secrets handling for Rails 8.