Skip to content

Latest commit

 

History

History
156 lines (120 loc) · 3.95 KB

File metadata and controls

156 lines (120 loc) · 3.95 KB

🐳 ActiveRabbit Docker Setup Complete!

What's Running in Docker

Your Rails 8.2 application is now fully containerized with:

🏗 Services Running

  • Web Application (activerabbit-web-1) - Rails server on port 3000
  • Background Jobs (activerabbit-sidekiq-1) - Sidekiq worker
  • Database (activerabbit-db-1) - PostgreSQL 15 on port 5432
  • Cache/Jobs (activerabbit-redis-1) - Redis on port 6380

📂 Docker Files Created

  • Dockerfile.dev - Development-optimized container
  • docker-compose.yml - Main service definitions
  • docker-compose.override.yml - Development overrides
  • .dockerignore - Optimized build context
  • init.sql - Database initialization
  • .env - Environment variables for Docker

🛠 Helper Scripts

  • ./bin/docker-setup - First-time setup
  • ./bin/docker-dev - Start development environment
  • ./bin/docker-console - Rails console in Docker
  • ./bin/docker-reset - Reset everything (destructive)

🚀 Quick Commands

Start Everything

# Full setup (first time)
./bin/docker-setup

# Start all services
docker-compose up

# Start in background
docker-compose up -d

Check Status

# View running containers
docker-compose ps

# View logs
docker-compose logs -f web
docker-compose logs -f sidekiq

Development Tasks

# Rails console
./bin/docker-console

# Run migrations
docker-compose exec web bundle exec rails db:migrate

# Install new gems
docker-compose run --rm web bundle install
docker-compose build  # Rebuild after gem changes

🌐 Access Points

📊 Container Status

All containers are healthy and running:

NAME                    STATUS                   PORTS
activerabbit-web-1       Up (healthy)            0.0.0.0:3000->3000/tcp
activerabbit-sidekiq-1   Up                      3000/tcp
activerabbit-db-1        Up (healthy)            0.0.0.0:5432->5432/tcp
activerabbit-redis-1     Up (healthy)            0.0.0.0:6380->6379/tcp

🔧 Features Working

  • Rails Application serving on port 3000
  • Database migrations completed
  • Tailwind CSS compiled and ready
  • Sidekiq processing background jobs
  • Devise authentication ready for users
  • Pay gem configured for Stripe
  • Rack::Attack protecting against abuse
  • Volume persistence for database and cache
  • Live reloading for development
  • Health checks for all services

🎯 Next Steps

  1. Visit the application: http://localhost:3000
  2. Create a user account to test authentication
  3. Add your Stripe keys to .env for payment testing
  4. Check Sidekiq dashboard: http://localhost:3000/sidekiq
  5. Start building your features!

🔄 Development Workflow

# Daily development
docker-compose up -d    # Start everything
# ... develop your app ...
docker-compose down     # Stop when done

# When you add gems
# 1. Update Gemfile
# 2. docker-compose run --rm web bundle install
# 3. docker-compose build
# 4. docker-compose up

# Database changes
docker-compose exec web bundle exec rails db:migrate

# View logs
docker-compose logs -f web

🚨 Troubleshooting

Container Won't Start

# Check logs
docker-compose logs web

# Rebuild containers
docker-compose build --no-cache
docker-compose up

Database Issues

# Reset database
docker-compose exec web bundle exec rails db:drop db:create db:migrate

# Connect directly to PostgreSQL
docker-compose exec db psql -U postgres -d activerabbit_development

Port Conflicts

# Check what's using ports
lsof -i :3000
lsof -i :5432
lsof -i :6380

# Stop conflicting services or change ports in docker-compose.yml

Your Rails application is now fully containerized and ready for development! 🎉