This is a minimal yet production-ready Rails 7 starter kit, fully Dockerized for local development with Postgres, Redis, and Sidekiq. It's optimized for modern Rails development using Hotwire (Turbo + Stimulus), TailwindCSS, and Sidekiq background jobs. Perfect for building Rails apps.
- Ruby 3.2 (Alpine Linux)
- Rails 7.1
- PostgreSQL 15 (Docker container)
- Redis 7 (Docker container)
- Sidekiq for background jobs
- Hotwire (Turbo + Stimulus)
- TailwindCSS (via tailwindcss-rails gem)
- Docker (no need to install Ruby, Rails, Postgres, or Redis on host)
git clone https://github.com/akshay-soni/dockerized_rails_starter_kit.git
cd your-app-folder
docker-compose build
If you're on Apple Silicon, run this once:
docker-compose run --rm web bundle lock --add-platform aarch64-linux
Then rebuild:
docker-compose build
If you haven't generated the app structure yet:
docker-compose run --no-deps web rails new . --force --database=postgresql --skip-javascript
Then fix config/database.yml
:
host: db
username: postgres
password: password
docker-compose run web rails db:create
docker-compose up
Visit: http://localhost:3000
- Add to your Gemfile:
gem 'hotwire-rails'
- Install the gem:
docker-compose run --rm web bundle install
- Install Hotwire:
docker-compose run --rm web rails hotwire:install
- Add to your Gemfile:
gem 'tailwindcss-rails'
- Install the gem:
docker-compose run --rm web bundle install
- Install TailwindCSS:
docker-compose run --rm web rails tailwindcss:install
- Optional: add this to any view to verify:
<div class="p-6 bg-indigo-100 text-indigo-800 font-bold rounded-xl shadow"> TailwindCSS is working! 🎉 </div>
# Bundle install after adding gems
docker-compose run --rm web bundle install
# Rebuild containers
docker-compose build
# Run Rails console
docker-compose run web rails console
# Run DB migrations
docker-compose run web rails db:migrate
# Run Sidekiq manually
docker-compose run web bundle exec sidekiq
- Add gem to
Gemfile
. - Run
bundle install
inside Docker:docker-compose run --rm web bundle install
- Rebuild the container:
docker-compose build
- Done! You can now use the gem inside your app.
💡 Tip: Always rebuild after changing the Gemfile or Dockerfile.
- Set
RAILS_ENV=development
indocker-compose.yml
for dev mode - Use
docker-compose down --remove-orphans
to clean up - Sidekiq dashboard can be added with:
# config/routes.rb
require 'sidekiq/web'
mount Sidekiq::Web => '/sidekiq'
- Devise or Auth setup
- Multi-tenant (via Apartment gem or custom solution)
- Procfile.dev or bin/dev integration
- VSCode devcontainer.json for one-click setup
Maintained by Akshay Soni. Built for fast and repeatable Rails app creation.
Happy Hacking! 🚀