Skip to content

Conversation

@sbafsk
Copy link
Collaborator

@sbafsk sbafsk commented Jan 24, 2026

Summary

This PR adds comprehensive Docker support for local deployment, following Docker best practices.

Features

Docker Compose Setup

  • PostgreSQL 15 Alpine with multi-database support (primary, cache, queue, cable)
  • Rails 8 with Thruster for production-ready HTTP serving
  • Solid Queue running inline with Puma for background jobs
  • Health checks for both web and database services
  • Resource limits (512M memory) for container management
  • tmpfs for cache/pids to reduce disk I/O

Dockerfile Improvements

  • Multi-stage build (base → build → production)
  • Official Ruby 3.3.6 slim image
  • Non-root user with explicit UID/GID 1000
  • jemalloc for memory optimization
  • OCI image labels for metadata
  • Comprehensive .dockerignore

New Files

  • docker-compose.yml - Full Docker Compose configuration
  • docker/init-databases.sh - Script to create additional PostgreSQL databases
  • docs/guides/local-docker-deployment.md - Deployment guide
  • .env.example - Template for required environment variables

Quick Start

# Setup
cp .env.example .env
# Edit .env with RAILS_MASTER_KEY from config/master.key

# Build and run
docker-compose build
docker-compose up -d

# Access at http://localhost:3003

Best Practices Applied

Practice Implementation
Multi-stage builds ✅ 3 stages
Official base images ✅ ruby:3.3.6-slim
Non-root USER ✅ UID/GID 1000
Health checks ✅ Both services
Resource limits ✅ 512M memory
Layer caching ✅ Gemfile first
.dockerignore ✅ Comprehensive

Testing

  • docker-compose build succeeds
  • docker-compose up -d starts both services
  • Health checks pass (both show "healthy")
  • App accessible at http://localhost:3003
  • Seeds load correctly (14 projects, 49 tasks)
  • Solid Queue starts inline with Puma

- Multi-stage build with official Ruby slim image
- PostgreSQL 15 Alpine with multi-database support (cache, queue, cable)
- Solid Queue running inline with Puma
- Health checks for both web and db services
- Resource limits (512M memory)
- tmpfs for cache/pids (performance)
- Non-root user with explicit UID/GID
- OCI image labels for metadata
- Comprehensive .dockerignore
@sbafsk sbafsk requested a review from Copilot January 24, 2026 17:10
@sbafsk sbafsk self-assigned this Jan 24, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive Docker support for local deployment of the Task Tracker application, enabling single-command setup and deployment using Docker Compose. The implementation follows Docker best practices with multi-stage builds, health checks, and proper resource management.

Changes:

  • Docker Compose configuration with PostgreSQL 15 and Rails 8 services
  • Multi-database support for Solid Cache, Queue, and Cable
  • Complete deployment documentation and troubleshooting guide
  • Real portfolio project data replacing example seed data

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
docker-compose.yml Defines services for PostgreSQL and Rails web application with health checks and resource limits
docker/init-databases.sh Initializes additional PostgreSQL databases for Rails 8 Solid components
Dockerfile Adds OCI image metadata labels
config/database.yml Adds environment variable configuration for multi-database URLs
.env.example Template for required environment variables
docs/guides/local-docker-deployment.md Comprehensive deployment guide with architecture diagrams and troubleshooting
db/seeds.rb Replaces example data with real portfolio projects and tasks
db/seeds_example.rb Preserves original example seed data for reference

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Remove db:migrate from build script (database not accessible during build)
- Add preDeployCommand for migrations (runs at deploy time)
- Remove explicit database names from cache/queue/cable (use URL only)
- Fixes: 'could not translate host name' error on Render
The bin/brakeman script uses --ensure-latest flag which causes CI to
fail when the installed version is not the latest available.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@sbafsk sbafsk temporarily deployed to feature/local-docker-deployment - task-tracker PR #30 January 24, 2026 19:52 — with Render Destroyed
Updates action_text-trix to 2.1.16 to address GHSA-g9jg-w8vm-g96v
(stored XSS vulnerability through attachment attribute).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@sbafsk sbafsk temporarily deployed to feature/local-docker-deployment - task-tracker PR #30 January 24, 2026 19:54 — with Render Destroyed
@sbafsk sbafsk temporarily deployed to feature/local-docker-deployment - task-tracker PR #30 January 24, 2026 19:59 — with Render Destroyed
@sbafsk sbafsk merged commit 75c1a2e into main Jan 24, 2026
5 checks passed
@sbafsk sbafsk deleted the feature/local-docker-deployment branch January 24, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants