Thank you for your interest in contributing to the Docker Python Guide! This guide will help you understand how you can effectively contribute to this project.
- Code of Conduct
- How to Contribute
- Project Structure
- Development Process
- Code Standards
- Reporting Issues
- Pull Requests
This project adheres to a code of conduct that we expect all participants to respect. Please read the Code of Conduct before participating.
There are several ways to contribute to this project:
- Improve module README files
- Fix typos
- Add additional examples
- Translate content
- Improve setup instructions
- Create new practical examples
- Improve existing exercises
- Add automation scripts
- Optimize Dockerfiles
- Add tests
- Find and report errors
- Validate fixes
- Test on different platforms
- Propose new modules
- Suggest content improvements
- Share best practices
docker-python-guide/
├── README.md # Main documentation (menu)
├── docs/ # General documentation
├── scripts/ # Automation scripts
│ ├── setup.sh # Setup for Linux/Mac
│ └── setup.ps1 # Setup for Windows
├── module-01-containerize/ # Separate branch
├── module-02-develop/ # Separate branch
├── module-03-linting-typing/ # Separate branch
├── module-04-cicd/ # Separate branch
└── module-05-deployment/ # Separate branch
Each module has its own branch with the following structure:
module-XX-name/
├── README.md # Module documentation
├── docs/ # Specific documentation
├── examples/ # Practical examples
├── exercises/ # Exercises for students
├── src/ # Source code
└── tests/ # Module tests
# Fork the project on GitHub
git clone https://github.com/YOUR-USERNAME/docker-python-guide.git
cd docker-python-guidegit remote add upstream https://github.com/AndCarrillo/docker-python-guide.git# For general contributions
git checkout -b feature/your-feature-name
# For module-specific contributions
git checkout module-01-containerize
git checkout -b feature/module-01-improvement- Follow code conventions
- Add tests if applicable
- Update documentation
- Test your changes
git add .
git commit -m "feat: clear description of the change"
git push origin feature/your-feature-name- Clearly describe the changes
- Reference related issues
- Include screenshots if visual
- Style: Follow PEP 8
- Formatting: Use Black
- Imports: Use isort
- Type hints: Use when possible
- Docstrings: Google style
Example:
def calculate_image_size(base_size: int, layers: int) -> int:
"""Calculate the total size of a Docker image.
Args:
base_size: Size of the base image in MB
layers: Number of additional layers
Returns:
Total estimated size in MB
Raises:
ValueError: If base_size or layers is negative
"""
if base_size < 0 or layers < 0:
raise ValueError("Size and layers must be non-negative")
return base_size + (layers * 50) # Estimate 50MB per layer- Multi-stage builds: When appropriate
- Command order: Optimize for cache
- Security: Don't use root user
- Size: Minimize image size
Example Dockerfile:
# Multi-stage build example
FROM python:3.11-slim as builder
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
FROM python:3.11-slim as runner
# Create non-root user
RUN groupadd -r appuser && useradd -r -g appuser appuser
WORKDIR /app
COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
COPY --from=builder /usr/local/bin /usr/local/bin
COPY . .
USER appuser
EXPOSE 8000
CMD ["python", "app.py"]- Markdown: Use standard syntax
- Structure: Consistent headers
- Examples: Include executable code
- Links: Verify they work
Use Conventional Commits format:
feat: add FastAPI example with PostgreSQL
fix: correct Dockerfile for Python 3.11
docs: update module 2 README
test: add tests for Docker Compose exercise
chore: update dependencies
Valid types:
feat: New functionalityfix: Bug fixdocs: Documentation changestest: Add or modify testschore: Maintenance tasksrefactor: Code refactoringstyle: Format changes
- Search existing issues
- Verify it's not a local problem
- Test with the latest version
## 🐛 Bug Description
Clear and concise description of the problem.
## 🔄 Steps to Reproduce
1. Go to '...'
2. Run '...'
3. Observe the error
## ✅ Expected Behavior
Description of what should happen.
## 📱 Environment
- OS: [e.g. Windows 11]
- Docker version: [e.g. 24.0.0]
- Python version: [e.g. 3.11]
- Branch/Module: [e.g. module-01-containerize]
## 📎 Additional Information
Logs, screenshots, etc.- Code follows established standards
- Tests pass (if applicable)
- Documentation updated
- Commits follow convention
- Branch updated with upstream
- PR template completed
## 📝 Description
Clear description of the changes made.
## 🎯 Type of Change
- [ ] Bug fix
- [ ] New functionality
- [ ] Breaking change
- [ ] Documentation
## 🧪 Testing
- [ ] Existing tests pass
- [ ] New tests added
- [ ] Manually tested
## 📋 Checklist
- [ ] Code follows project standards
- [ ] Self-review completed
- [ ] Documentation updated
- [ ] Commits follow convention
## 🔗 Related Issues
Closes #123We use the following labels:
bug: Something doesn't workenhancement: New functionalitydocumentation: Documentation improvementsgood first issue: Good for beginnershelp wanted: Extra help welcomemodule-01: Related to module 1module-02: Related to module 2- etc.
All contributors will be recognized in:
- Main README
- Contributors list
- Release notes
- Open an issue with
questionlabel - Discuss in GitHub Discussions
- Review existing documentation
Thank you for contributing to the Docker Python Guide! 🚀