Skip to content

Conversation

@ckrough
Copy link
Owner

@ckrough ckrough commented Dec 22, 2025

Summary

This PR standardizes the project on Python 3.13 and adds production-ready Docker containerization for local testing.

Python 3.13 Standardization

  • Updated requires-python = ">=3.13" in pyproject.toml
  • Updated ruff target-version = "py313"
  • Updated mypy python_version = "3.13"
  • Updated both GitHub Actions CI jobs to Python 3.13
  • Regenerated uv.lock with correct Python 3.13 constraint
  • Updated all documentation (README, CONTRIBUTING, CLAUDE.md, architecture docs, ADRs)

Docker Containerization

New files:

  • Dockerfile - Multi-stage production build with Python 3.13-slim
  • docker-compose.yml - Container management with named volumes
  • .dockerignore - Build optimization
  • entrypoint.sh - Proper signal handling for graceful shutdowns

Key features:

  • Production-ready multi-stage build (builder + runtime)
  • Non-root user (appuser, uid 1000) for security
  • Named volumes for data persistence (SQLite + Chroma + documents)
  • Health checks with database verification
  • ChromaDB native dependencies included
  • 640MB final image size

Development workflow:

  • Active development: Host with uv run uvicorn --reload
  • Docker: Test production build locally before cloud deployment

Health Check Enhancement

  • Enhanced /health endpoint to verify database connectivity
  • Returns HTTP 503 on dependency failure
  • Logs health check failures with structured logging

Documentation Updates

  • README.md: Comprehensive Docker deployment section with volume management
  • CONTRIBUTING.md: Docker development workflow
  • docs/guides/deployment.md: Full Docker deployment guide with backup/restore
  • docs/development-standards.md: Docker testing workflow
  • docs/increments.md: Added Increment 14 (Docker) and 15 (Cloud Run)
  • All Python version references updated to 3.13

Type

  • Feature
  • Bug fix
  • Refactor
  • Documentation
  • Tests

Testing

Python 3.13 Verification

  • ✅ All type checks pass with mypy (Python 3.13)
  • ✅ All linting passes with ruff (py313 target)
  • ✅ uv.lock regenerated successfully
  • ✅ CI configuration uses Python 3.13

Docker Testing

  • ✅ Image builds successfully (640MB)
  • ✅ Container starts and passes health checks
  • ✅ Database connectivity verified in health endpoint
  • ✅ ChromaDB native dependencies working
  • ✅ Proper signal handling (SIGTERM)
  • ✅ Data persists across container restarts
  • ✅ Non-root user verified (appuser)

Checklist

  • Tests pass
  • Types check
  • Docs updated
  • Lock file regenerated
  • Docker image tested locally
  • Health checks verified

- Add comprehensive tests for OpenAIModerator and NoOpModerator
- Add tests for authentication/authorization dependencies
- Coverage increased from 79.17% to 81.26%
- Update Python version requirement from 3.12 to 3.13 across all configs
  - pyproject.toml: requires-python, ruff target-version, mypy python_version
  - .github/workflows/ci.yml: both CI jobs now use Python 3.13
  - Regenerated uv.lock with Python 3.13 constraint

- Add production Docker support
  - Multi-stage Dockerfile with Python 3.13-slim
  - docker-compose.yml for container management
  - .dockerignore for build optimization
  - entrypoint.sh for proper signal handling
  - Named volumes for data persistence

- Enhance health check endpoint
  - Verify database connectivity
  - Return 503 on dependency failure
  - Log health check failures

- Update all documentation
  - README.md: Docker deployment section with volume management
  - CONTRIBUTING.md: Docker development workflow
  - docs/guides/deployment.md: Comprehensive Docker guide
  - docs/development-standards.md: Docker testing workflow
  - docs/increments.md: Added Increment 14 (Docker) and 15 (Cloud Run)
  - Updated Python version in architecture docs and ADRs
@ckrough ckrough merged commit 38a8db0 into main Dec 22, 2025
1 of 2 checks passed
@ckrough ckrough deleted the gallant-booth branch December 22, 2025 21:10
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