Docker Rails Example

screenshot of Docker Rails Example
rails
tailwind

A production ready example Rails app that's using Docker and Docker Compose.

Overview

The example Rails + Docker app serves as an exemplary foundation for developers looking to kickstart a new project or transition an existing Rails application into a Dockerized environment. It provides a streamlined setup that includes essential components often utilized in real-world applications while avoiding unnecessary complexity or opinion-based choices. Built on the latest versions of Rails 8.1.2 and Ruby 4.0.0, this app draws from best practices established throughout years of deploying various Dockerized web applications.

What stands out about this app is its adherence to Docker best practices, combined with its thoughtful selection of modern technologies. It not only facilitates a straightforward understanding of Docker for Rails but also offers a clean slate for developers to customize according to their specific needs.

Features

  • Comprehensive Tech Stack: Utilizes a robust combination of tools including PostgreSQL for databases, Redis for caching, and Sidekiq for background jobs, ensuring effective performance.
  • Environment Configuration: Credentials are securely managed through an .env file, and numerous configuration settings are exported into environment variables to enhance flexibility.
  • Custom Front-End Setup: Incorporates modern front-end technologies like esbuild and TailwindCSS, allowing for efficient styling and UI development.
  • API Health Checks: Features a pages controller with health check actions to monitor the app's operational status effortlessly.
  • Optimized Logging: Logs are directed to STDOUT, enabling Docker to capture and manage log output conveniently.
  • Docker Integration: Multiple Docker-related files have been included to streamline the deployment and management of the application within a containerized environment.
  • Automatic Resource Management: GitHub Actions are set up to facilitate continuous integration and deployment, simplifying the development workflow.
  • Enhanced Assets Handling: ActiveStorage and Hotwire Spark are integrated for improved asset management and live reloading during development, enhancing user experience.
rails
Ruby on Rails

Ruby on Rails, often referred to as Rails, is an open-source web application framework written in Ruby. Known for its convention over configuration and don't repeat yourself (DRY) principles, Rails simplifies and accelerates the development of database-backed web applications.

tailwind
Tailwind

Tailwind CSS is a utility-first CSS framework that provides pre-defined classes for building responsive and customizable user interfaces.

fullstack
Fullstack

A fullstack boilerplate provides a starter application that includes both frontend and backend. It should include database, auth, payments, user roles and other backend services to build a fully featured saas or webapps.

docker
Docker

A website that uses Docker for containerization to streamline development, testing, and deployment workflows. This includes features such as containerization of dependencies, automated builds and deployments, and container orchestration to ensure scalability and availability.