A minimal FastAPI baseline for KubeRocketCI. It uses uv for dependencies, pytest for tests, ruff for linting + formatting and a small non-root Docker image.
- Python 3.12+
- uv
- Docker
.
├── app/main.py # FastAPI application
├── tests/ # pytest tests
├── pyproject.toml # dependencies and tool config
├── uv.lock # locked dependency versions
├── Dockerfile
├── .gitignore
└── .dockerignore
uv sync # create .venv from uv.lock
uv run uvicorn app.main:app --reload --port 8080Open http://localhost:8080/docs for the interactive API docs.
| Method | Path | Description |
|---|---|---|
| GET | /healthz |
Liveness/readiness probe, returns ok |
| GET | /items/{id} |
Example endpoint, optional ?q= param |
uv run pytest # run tests
uv run ruff check . # lint
uv run ruff format . # formatManage dependencies with uv, then commit pyproject.toml and uv.lock:
uv add <package> # runtime dependency
uv add --dev <package> # dev-only dependency
uv lock --upgrade # bump all locked versionsdocker build -t myimage .
docker run --rm -p 8080:8080 myimage
curl http://localhost:8080/healthzThe image is multi-stage and runs as a non-root user (UID 10001) on port 8080. Use /healthz for Kubernetes liveness and readiness probes.
The version lives in pyproject.toml. Print it with:
uv version --short