Add Dockerfile and Woodpecker CI pipeline #6

Closed
opened 2026-03-22 07:56:20 +00:00 by forgejo_admin · 0 comments

Type

Feature

Repo

forgejo_admin/minio-api

Lineage

plan-minio-mobile → Phase 2 → Phase 2c (k8s Deployment + CI)

User Story

As a platform operator
I want the minio-api service containerized with automated CI
So that every push to main builds, tests, lints, and publishes a Docker image to Harbor

Context

The minio-api FastAPI service is code-complete (15 endpoints, 90 tests, Keycloak auth). This adds the container and CI pipeline so it can be deployed to k3s. Follow the same pattern as basketball-api and mcd-tracker-api.

Harbor registry: harbor.tail5b443a.ts.net
Woodpecker CI: ci.tail5b443a.ts.net
Forgejo PyPI (for minio-sdk dependency): https://forgejo.tail5b443a.ts.net/api/packages/forgejo_admin/pypi/simple/

File Targets

Files to create:

  • Dockerfile — Python 3.12-slim, install deps (including minio-sdk from Forgejo PyPI), uvicorn entrypoint
  • .woodpecker.yml — pipeline: lint (ruff), test (pytest), build image, push to Harbor

Files to modify:

  • .woodpecker.yml if it already exists — update to include Docker build/push steps

Acceptance Criteria

  • docker build . succeeds locally
  • docker run starts uvicorn and serves /docs
  • Woodpecker pipeline: lint → test → build → push to Harbor
  • minio-sdk installed from Forgejo PyPI inside the container (not vendored)
  • Image tagged with commit SHA and latest
  • Health check endpoint at /health (simple 200 OK)
  • Environment variables documented: MINIO_ENDPOINT, MINIO_ACCESS_KEY, MINIO_SECRET_KEY, KEYCLOAK_URL, KEYCLOAK_REALM, AUTH_DISABLED

Test Expectations

  • Existing 90 tests still pass in CI pipeline
  • docker build . completes without errors
  • Container starts and responds to health check
  • Run command: pytest tests/ -v (in CI pipeline)

Constraints

  • Base image: python:3.12-slim
  • Use pip install with --extra-index-url for Forgejo PyPI
  • Harbor project: minio-api (may need to be created)
  • Multi-stage build if it reduces image size significantly
  • Follow existing CI patterns from basketball-api or mcd-tracker-api

Checklist

  • PR opened
  • Tests pass
  • No unrelated changes
  • phase-minio-mobile-2c-k8s-deploy — phase note
  • project-minio-mobile — project this advances
### Type Feature ### Repo `forgejo_admin/minio-api` ### Lineage `plan-minio-mobile` → Phase 2 → Phase 2c (k8s Deployment + CI) ### User Story As a platform operator I want the minio-api service containerized with automated CI So that every push to main builds, tests, lints, and publishes a Docker image to Harbor ### Context The minio-api FastAPI service is code-complete (15 endpoints, 90 tests, Keycloak auth). This adds the container and CI pipeline so it can be deployed to k3s. Follow the same pattern as basketball-api and mcd-tracker-api. Harbor registry: `harbor.tail5b443a.ts.net` Woodpecker CI: `ci.tail5b443a.ts.net` Forgejo PyPI (for minio-sdk dependency): `https://forgejo.tail5b443a.ts.net/api/packages/forgejo_admin/pypi/simple/` ### File Targets Files to create: - `Dockerfile` — Python 3.12-slim, install deps (including minio-sdk from Forgejo PyPI), uvicorn entrypoint - `.woodpecker.yml` — pipeline: lint (ruff), test (pytest), build image, push to Harbor Files to modify: - `.woodpecker.yml` if it already exists — update to include Docker build/push steps ### Acceptance Criteria - [ ] `docker build .` succeeds locally - [ ] `docker run` starts uvicorn and serves `/docs` - [ ] Woodpecker pipeline: lint → test → build → push to Harbor - [ ] minio-sdk installed from Forgejo PyPI inside the container (not vendored) - [ ] Image tagged with commit SHA and `latest` - [ ] Health check endpoint at `/health` (simple 200 OK) - [ ] Environment variables documented: `MINIO_ENDPOINT`, `MINIO_ACCESS_KEY`, `MINIO_SECRET_KEY`, `KEYCLOAK_URL`, `KEYCLOAK_REALM`, `AUTH_DISABLED` ### Test Expectations - [ ] Existing 90 tests still pass in CI pipeline - [ ] `docker build .` completes without errors - [ ] Container starts and responds to health check - Run command: `pytest tests/ -v` (in CI pipeline) ### Constraints - Base image: `python:3.12-slim` - Use `pip install` with `--extra-index-url` for Forgejo PyPI - Harbor project: `minio-api` (may need to be created) - Multi-stage build if it reduces image size significantly - Follow existing CI patterns from basketball-api or mcd-tracker-api ### Checklist - [ ] PR opened - [ ] Tests pass - [ ] No unrelated changes ### Related - `phase-minio-mobile-2c-k8s-deploy` — phase note - `project-minio-mobile` — project this advances
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forgejo_admin/minio-api#6
No description provided.