feat: add Dockerfile and Woodpecker CI pipeline #7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "6-add-dockerfile-and-woodpecker-ci-pipeline"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds container build and CI pipeline for minio-api. Multi-stage Dockerfile keeps the runtime image slim (no git, no build tools). Woodpecker pipeline lints, tests, and builds/pushes to Harbor on merge to main.
Changes
Dockerfile-- Multi-stage build on python:3.12-slim. Builder stage installs git (needed forgit+https://minio-sdk dependency) and runspip install --extra-index-urlpointing at Forgejo PyPI. Runtime stage copies only site-packages and source, runs uvicorn on port 8000..woodpecker.yaml-- Clone override (cluster-internal Forgejo URL), test step (ruff check + ruff format --check + pytest unit tests), build-and-push step (kaniko toharbor.tail5b443a.ts.net/minio-api/api:{sha}). Build only runs on push to main..dockerignore-- Excludes .venv, tests, docs, cache dirs from build context.Test Plan
docker build .succeeds locallydocker runwith env vars starts uvicorn,/healthreturns 200harbor.tail5b443a.ts.net/minio-api/apiReview Checklist
/healthminio-apimay need to be created before first push to mainRelated
plan-minio-mobile(traceability)Closes #6
PR #7 Review
DOMAIN REVIEW
Tech stack: Python 3.12 / FastAPI / Dockerfile (multi-stage) / Woodpecker CI / Kaniko / Harbor
Dockerfile (
Dockerfile, 26 lines)base->builder->runtime. Correct pattern matching basketball-api.git(needed becausepyproject.tomldeclaresminio-sdk @ git+https://...), then uses--extra-index-urlpointing at Forgejo PyPI. Both paths are covered -- if the package is on the PyPI index it resolves there, otherwise falls back to the git reference. This is sound.site-packages,/usr/local/bin, andsrc/. No build tools, no git, no.venvin the final image. Clean.BUILD_SHAARG piped to ENV -- matches basketball-api pattern.PYTHONPATH=/app/src,EXPOSE 8000, uvicorn binding to0.0.0.0:8000-- all correct.Woodpecker CI (
.woodpecker.yaml, 43 lines)http://forgejo-http.forgejo.svc.cluster.local:80/${CI_REPO}.git-- matches basketball-api pattern and the platform fix in commit763af17.git, creates venv, installs.[dev]with--extra-index-url, runsruff check,ruff format --check, thenpyteston the 3 unit test files (63 tests). Integration tests (test_buckets,test_objects,test_presign,test_multipart) are correctly excluded since CI has no MinIO service container.harbor.tail5b443a.ts.net/minio-api/apiwith tags${CI_COMMIT_SHA},latest. Credentials fromharbor_username/harbor_passwordsecrets. Build only on push to main. Correct..dockerignore (11 entries)
.venv/,__pycache__/,*.pyc,.pytest_cache/,.ruff_cache/,.git/,.gitignore,.claude/,tests/,README.md,CLAUDE.md. Comprehensive and correct.Health endpoint: Confirmed at
/healthinsrc/minio_api/main.py:52-55, returns{"status": "ok"}.BLOCKERS
None.
from_secret.NITS
latesttag divergence: Thetagsfield uses"${CI_COMMIT_SHA},latest"but basketball-api and mcd-tracker-api only tag with${CI_COMMIT_SHA}. Addinglatestis not wrong (it is common practice), but it diverges from the established platform pattern. Consider aligning for consistency, or accept the divergence as intentional for minio-api's deployment model.Missing clone override in mcd-tracker-api: This is not a minio-api issue, but noting that mcd-tracker-api lacks the clone override while basketball-api and minio-api both have it. Discovered scope for mcd-tracker-api.
Test count mismatch in PR body: PR body says "63 unit tests" but the actual count across the 3 unit test files is 63 functions. The conftest has 1
test_function too (likely a false positive in my grep --test_bucket_nameis a fixture, not a test). Accurate enough, no action needed.Harbor project pre-creation: PR checklist correctly notes
Harbor project minio-api may need to be created before first push to main. This should be verified before merge to avoid the first CI build failing on push.SOP COMPLIANCE
6-add-dockerfile-and-woodpecker-ci-pipelinereferences issue #6plan-minio-mobilereferencedfrom_secret, no plaintext credentials anywherefeat: add Dockerfile and Woodpecker CI pipelinePROCESS OBSERVATIONS
latesttag is the only divergence.minio-apimust exist before merging, or the first build-and-push step will fail.VERDICT: APPROVED