Skip to content

feat(docker): add development containers with hot reload - #17

Merged
mjunaidca merged 3 commits into
mainfrom
008-dev-containers
Dec 8, 2025
Merged

feat(docker): add development containers with hot reload#17
mjunaidca merged 3 commits into
mainfrom
008-dev-containers

Conversation

@mjunaidca

Copy link
Copy Markdown
Owner

Summary

Add complete development container environment with hot reload support for all 4 application services.

Changes

  • compose.dev.yaml: Development-optimized compose using Dockerfile.dev builds
  • docker-dev.sh: Startup script with --clean, --logs, --quick, --stop flags
  • Dockerfile.dev: Per-service development images with polling-based file watching
    • sso-platform: Next.js dev server with Fast Refresh
    • web-dashboard: Next.js dev server with Fast Refresh
    • api: uvicorn --reload with watchfiles polling
    • mcp-server: uvicorn --reload with watchfiles polling

Key Features

  • Anonymous volumes for node_modules (platform safety - Linux containers vs macOS host)
  • Polling-based file watching (macOS Docker compatible via WATCHFILES_FORCE_POLLING)
  • SSO migrations run from host before services start
  • Project name taskflow-dev distinguishes from production containers

Usage

./docker-dev.sh          # Start dev environment
./docker-dev.sh --logs   # Start and follow logs
./docker-dev.sh --clean  # Clean volumes and restart
./docker-dev.sh --stop   # Stop dev environment

Hot Reload

  • Edit packages/api/src/**/*.py → auto-reload in ~3-5s
  • Edit web-dashboard/src/**/* → Fast Refresh in ~3s

Test plan

  • Run ./docker-dev.sh and verify all 5 services start
  • Modify a Python file and verify uvicorn reloads
  • Modify a React file and verify Fast Refresh works
  • Run ./docker-dev.sh --stop and verify cleanup

🤖 Generated with Claude Code

Add complete development container environment with hot reload support:

- compose.dev.yaml: Development-optimized compose with Dockerfile.dev builds
- docker-dev.sh: Startup script with --clean, --logs, --quick, --stop flags
- Dockerfile.dev: Per-service dev images with polling-based file watching
  - sso-platform: Next.js dev server with Fast Refresh
  - web-dashboard: Next.js dev server with Fast Refresh
  - api: uvicorn --reload with watchfiles polling
  - mcp-server: uvicorn --reload with watchfiles polling

Key features:
- Anonymous volumes for node_modules (platform safety)
- Polling-based watching (macOS Docker compatible)
- SSO migrations run from host before services start
- Project name taskflow-dev distinguishes from production

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings December 8, 2025 17:57
@mjunaidca
mjunaidca merged commit ba6d712 into main Dec 8, 2025
5 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

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 introduces a comprehensive development container environment with hot reload capabilities for all TaskFlow services, enabling rapid iteration during development without image rebuilds.

Key Changes:

  • Development-optimized Docker Compose configuration with volume mounts for live code editing
  • Automated startup script with multiple operational modes (quick restart, clean volumes, log viewing)
  • Service-specific development Dockerfiles with polling-based file watching for cross-platform compatibility

Reviewed changes

Copilot reviewed 18 out of 19 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
compose.dev.yaml Development Docker Compose with hot reload for all 5 services (postgres, pgadmin, sso-platform, api, mcp-server, web-dashboard)
docker-dev.sh Startup script with flags for quick restart, clean volumes, log viewing, and graceful shutdown
dev-local.sh Alternative local development script for running services without Docker
sso-platform/Dockerfile.dev Next.js development image with Fast Refresh and polling-based file watching
web-dashboard/Dockerfile.dev Next.js development image with Fast Refresh and polling-based file watching
packages/api/Dockerfile.dev FastAPI development image with uvicorn auto-reload and watchfiles polling
packages/mcp-server/Dockerfile.dev MCP server development image with uvicorn auto-reload and watchfiles polling
web-dashboard/src/app/page.tsx Minor content change ("revolutionizes" → "rethinks") for hot reload testing
packages/api/src/taskflow_api/main.py Version bump (1.0.0 → 1.0.1) for hot reload testing
.gitignore Added pnpm-store and .pnpm-store/ to ignore list
specs/008-dev-containers/* Complete specification, plan, tasks, and checklist documentation
history/prompts/008-dev-containers/* Development history and prompt documentation

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

Comment thread docker-dev.sh
Comment on lines +94 to +104
echo -e "${YELLOW}[1/5] Checking for production containers...${NC}"
if docker compose -p "$PROD_PROJECT_NAME" ps -q 2>/dev/null | grep -q .; then
echo -e "${YELLOW} Stopping production containers...${NC}"
docker compose -p "$PROD_PROJECT_NAME" down 2>/dev/null || true
echo -e "${GREEN} Production containers stopped.${NC}"
else
echo -e "${GREEN} No production containers running.${NC}"
fi

# Step 2: Stop existing dev containers
echo -e "${YELLOW}[2/5] Stopping existing dev containers...${NC}"

Copilot AI Dec 8, 2025

Copy link

Choose a reason for hiding this comment

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

Inconsistent step numbering: Steps 1-2 show "[X/5]" format, but steps 3-6 show "[X/6]" format. All steps should consistently show the correct total count of 6 steps.

Copilot uses AI. Check for mistakes.
# Install dependencies first (cached layer)
COPY pyproject.toml README.md ./
COPY src/ ./src/
RUN uv pip install --system -e '.[dev]'

Copilot AI Dec 8, 2025

Copy link

Choose a reason for hiding this comment

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

[nitpick] Consider adding UV_HTTP_TIMEOUT=120 to the uv pip install command for consistency with the MCP server Dockerfile.dev (line 18 in packages/mcp-server/Dockerfile.dev). This ensures both services have the same timeout configuration for dependency installation.

Suggested change
RUN uv pip install --system -e '.[dev]'
RUN UV_HTTP_TIMEOUT=120 uv pip install --system -e '.[dev]'

Copilot uses AI. Check for mistakes.
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