Complete Docker guide for Python developers - Learn to containerize, develop, and deploy Python applications using Docker with hands-on examples.
Master Docker for Python development through practical, progressive modules:
- 🐳 Containerize Python apps (Flask & FastAPI)
- 🔧 Set up local development with Docker Compose
- ✨ Implement code quality (linting, formatting, typing)
- 🚀 Build CI/CD pipelines with GitHub Actions
- ☸️ Deploy with Kubernetes locally
| Module | Topic | Level | Branch |
|---|---|---|---|
| 01 | 🐳 Containerization | Beginner | module-01-containerize |
| 02 | 🔧 Development Setup | Intermediate | module-02-develop |
| 03 | ✨ Code Quality | Intermediate | module-03-linting-typing |
| 04 | 🚀 CI/CD Pipeline | Advanced | module-04-cicd |
| 05 | ☸️ Deployment | Advanced | module-05-deployment |
🏆 Final Project: project-complete - Complete implementation with all optimizations
- 🐳 Docker Desktop
- 🐍 Python 3.9+
- 📂 Git
- 📝 VS Code (recommended)
# Clone the repository
git clone https://github.com/AndCarrillo/docker-python-guide.git
cd docker-python-guide
# Start with Module 1
git checkout module-01-containerize
# Follow the README instructions in that branch📖 View complete workflow guide →
| Framework | Purpose | Learning Focus |
|---|---|---|
| 🧪 Flask | Simple web framework | Fundamentals, SQL databases, traditional patterns |
| ⚡ FastAPI | Modern async framework | Performance, async/await, auto-documentation |
- 🧪 Flask + PostgreSQL - Traditional web app with relational database
- ⚡ FastAPI + Redis - Modern API with caching and async operations
- 🔧 Multi-stage builds - Optimized Docker images
- 🚀 Complete CI/CD - Automated pipelines with GitHub Actions
- ☸️ Kubernetes deployment - Local testing and deployment
Create optimized Docker images for Python applications.
- Dockerfiles and best practices
- Security and non-root users
- Multi-stage builds
- Health checks
Set up local development environment.
- Docker Compose for development
- Hot reload and debugging
- Environment variables and secrets
- Database integration
Implement linting, formatting, and type checking.
- Ruff for linting and formatting
- mypy for type checking
- Pre-commit hooks
- VS Code integration
Automate builds with GitHub Actions.
- Automated testing and building
- Docker image publishing
- Multi-environment deployment
- Security scanning
Deploy and test with Kubernetes.
- Local Kubernetes setup
- Health checks and monitoring
- Rolling updates and rollbacks
- Debugging containerized apps
- ✅ Step-by-step tutorials with detailed explanations
- ✅ Ready-to-use code in every example
- ✅ Industry best practices and patterns
- ✅ Hands-on exercises to reinforce learning
- ✅ Troubleshooting guides for common issues
- Docker Documentation
- Python Docker Best Practices
- Flask Documentation
- FastAPI Documentation
- GitHub Actions Documentation
Contributions welcome! See Contributing Guide for:
- Reporting issues
- Submitting improvements
- Code standards
- Development workflow
MIT License - see LICENSE for details.
📅 Last updated: July 2025
👨💻 Maintained by: Andrea Carrillo