Phase 2: Backend Scaffold + First Deploy

phase-mcd-tracker-2-backend-scaffold Phase

phase
Goal: FastAPI skeleton running in prod — health endpoint responding, CI green, ArgoCD syncing. ImagePullBackOff resolves.
Owner: Dev agent
Repo: forgejo_admin/mcd-tracker-api
Depends on: Phase 1 (COMPLETED — namespace, Harbor, ArgoCD app all live)

Scope

Scaffold the FastAPI app following the basketball-api pattern exactly. Push first image to Harbor. ArgoCD auto-deploys. Health endpoint responds.
  • Scaffold FastAPI app:
  • Add Dockerfile — multi-stage Python build (builder + runtime), expose 8000
  • Add .woodpecker.yaml — two steps: test (ruff + pytest) and build-and-push (kaniko to Harbor). Use ${CI_COMMIT_SHA} as image tag.
  • Activate Woodpecker on mcd-tracker-api repo
  • Add Harbor secrets to Woodpecker repo settings (harbor_username, harbor_password — get from tofu output)
  • Push to main → green pipeline → Harbor image → ArgoCD auto-deploys

Architecture Touch

arch-deployment-mcd-tracker — this phase populates the API pod in the deployment diagram. arch-dataflow-mcd-tracker — health endpoint is the first runtime flow (trivial). No diagram updates needed.

Verification

  • curl https://mcd-tracker.tail5b443a.ts.net/healthz returns 200
  • Woodpecker pipeline green on mcd-tracker-api
  • Harbor shows mcd-tracker/api image with SHA tag
  • ArgoCD app mcd-tracker healthy (no more ImagePullBackOff)
  • Pods: mcd-tracker (1/1 Running), postgres (1/1 Running)

  • pending
  • plan-mcd-tracker — parent plan
  • phase-mcd-tracker-1-service-onboarding — depends on (infra ready)
  • arch-deployment-mcd-tracker — deployment diagram