PyMetrics ships as a Docker Compose stack with six services: backend (FastAPI), worker (Celery), flower, frontend (nginx), redis, and minio. A one-shot data-init container normalizes bind-mount permissions on Windows/macOS hosts, and minio-init creates the object-storage bucket before the worker comes up.
3000, 5555, 6379, 8000, 9000, 9001 free on the host.git clone https://github.com/cagatayuresin/py-metrics.git
cd py-metrics
cp .env.example .env
docker compose up -d
Wait until docker compose ps shows every service as healthy. Then open:
minioadmin / minioadmin)The most relevant knobs (full list in .env.example):
| Variable | Default | Purpose |
|---|---|---|
CLONE_SHALLOW |
true |
git clone --depth 1. Fast, but leaves git-history metric columns empty. |
CLONE_DEPTH |
1 |
Depth passed to shallow clone. |
PYLINT_ENABLED |
true |
Toggle Pylint subprocess. Off cuts analysis time roughly in half. |
MAX_REPO_SIZE_MB |
500 |
Reject larger repositories up front. |
MAX_FILE_COUNT |
5000 |
Hard cap on Python files analyzed per repo. |
AUTH_ENABLED |
false |
When true, SECRET_KEY must be set to a real secret. |
S3_ENDPOINT_URL |
http://minio:9000 |
Object storage endpoint for ZIP/CSV artifacts. |
MINIO_ROOT_USER / MINIO_ROOT_PASSWORD and S3_ACCESS_KEY / S3_SECRET_KEY.ENVIRONMENT=production, rotate SECRET_KEY, and pin CORS_ORIGINS to the actual origins.LOG_FORMAT=json for structured logs that your aggregator can ingest.frontend and backend; the compose file binds on 0.0.0.0 for local convenience only.# Backend tests
docker compose run --rm --no-deps backend pytest
# Rebuild frontend production image
docker compose build frontend
# Follow runtime logs
docker compose logs -f backend worker frontend
Host virtualenvs and host node_modules are not required for normal project verification. The Compose stack is the reference environment.