A clean Cookiecutter template for building production-ready Dockerized Python apps with:
- Docker
- uv
- Devcontainers
- Ruff
- pre-commit hooks.
Install uv if you still don't have it and execute:
latest version:
uvx cookiecutter gh:rafahuelin/cookiecutter-docker-python-uvspecific version (v1.0.1 in this example):
uvx cookiecutter gh:rafahuelin/cookiecutter-docker-python-uv --checkout v1.0.1create project without input
uvx cookiecutter gh:rafahuelin/cookiecutter-docker-python-uv --no-input project_name="My project" description="My Python app" python_version="3.14"📁 your-project/
├── .devcontainer/
│ ├── .env
│ ├── devcontainer.json
│ └── docker-compose.dev.yml
├── src/
│ └── main.py
├── tests/
│ ├── conftest.py
│ └── test_main.py
├── .env
├── .env.example
├── .gitignore
├── .pre-commit-config.yaml
├── .python-version
├── Dockerfile
├── pyproject.toml
├── README.md
└── uv.lock
- Generate Project

- Open Project

- Install Devcontainers extension

- Run Tests with coverage

- Debug Tests

- Linter

- Dockerized Python Development setup with global uv setup (without virtual environment)
- Uses only actively supported CPython versions
- Offered at project creation and pinned in the base image and .python-version.
- Single Dockerfile for dev and production
- Develop locally with the same Dockerfile that builds your production image.
- VS Code Dev Container setup
- Docker Compose-based dev environment.
- Workspace is bind-mounted so Git status and changes behave exactly as on the host.
- User UID and GID makes possible to edit files from inside or outside the devcontainer.
- Linter with Error Lens and Ruff.
- Fast dependency management with uv
- pyproject.toml-based workflow with uv for speedy, reproducible installs.
- Testing scaffold
- pytest pre-configured with example tests.
- coverage library pre-installed.
- Pre-commit hooks ready
- Linting/formatting hooks configured via .pre-commit-config.yaml.
- Environment management
- .env.example provided; .env consumed by the dev setup.