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.