GSD: M001 COMPLETE — media.rip() v1.0, all 6 slices done

S01: Foundation + Download Engine
S02: SSE Transport + Session System
S03: Frontend Core
S04: Admin, Auth + Supporting Features
S05: Theme System
S06: Docker + CI/CD

211 total tests (182 backend + 29 frontend).
This commit is contained in:
xpltd 2026-03-18 19:32:11 -05:00
parent 878ca56419
commit b145dffce4
3 changed files with 141 additions and 1 deletions

View file

@ -74,7 +74,7 @@ This milestone is complete only when all are true:
- [x] **S05: Theme System** `risk:low` `depends:[S03]` - [x] **S05: Theme System** `risk:low` `depends:[S03]`
> After this: Cyberpunk theme renders with scanlines/grid overlay, JetBrains Mono, #00a8ff/#ff6b2b. Dark and light themes are clean alternatives. CSS variable contract documented in base.css. Drop a custom theme folder into /themes volume → restart → appears in picker → applies correctly. Built-in themes heavily commented as documentation. Proven by theme switching and custom theme load. > After this: Cyberpunk theme renders with scanlines/grid overlay, JetBrains Mono, #00a8ff/#ff6b2b. Dark and light themes are clean alternatives. CSS variable contract documented in base.css. Drop a custom theme folder into /themes volume → restart → appears in picker → applies correctly. Built-in themes heavily commented as documentation. Proven by theme switching and custom theme load.
- [ ] **S06: Docker + CI/CD** `risk:low` `depends:[S01,S02,S03,S04,S05]` - [x] **S06: Docker + CI/CD** `risk:low` `depends:[S01,S02,S03,S04,S05]`
> After this: `docker compose up` → app works at :8080 with zero config. `docker-compose.example.yml` includes Caddy/Traefik sidecar for TLS. Tag v0.1.0 → GitHub Actions builds multi-arch image → pushes to GHCR + Docker Hub → creates GitHub Release. PR triggers lint + test + Docker smoke. Zero outbound telemetry verified. Proven by running the published image and completing a full download flow. > After this: `docker compose up` → app works at :8080 with zero config. `docker-compose.example.yml` includes Caddy/Traefik sidecar for TLS. Tag v0.1.0 → GitHub Actions builds multi-arch image → pushes to GHCR + Docker Hub → creates GitHub Release. PR triggers lint + test + Docker smoke. Zero outbound telemetry verified. Proven by running the published image and completing a full download flow.
## Boundary Map ## Boundary Map

View file

@ -0,0 +1,75 @@
# S06: Docker + CI/CD
**Goal:** Package the complete application into a production Docker image, create docker-compose configs for zero-config and secure deployment, and set up GitHub Actions CI/CD for lint/test on PR and build/push on tag.
**Demo:** `docker compose up` → app works at :8080 with zero config. Tag v0.1.0 → GitHub Actions builds multi-arch image → pushes to GHCR. PR triggers lint + test.
## Must-Haves
- Multi-stage Dockerfile: build frontend, install backend deps, minimal runtime image
- docker-compose.yml for zero-config startup
- docker-compose.example.yml with reverse proxy (Caddy) for TLS
- GitHub Actions: CI workflow (PR: lint + test), Release workflow (tag: build + push)
- Multi-arch support: amd64 + arm64
- Health check in Docker and compose
- Zero outbound telemetry verification
## Proof Level
- This slice proves: operational + final-assembly
- Real runtime required: yes (Docker build + run)
- Human/UAT required: yes (verify full flow in container)
## Verification
- `docker build -t media-rip .` — image builds successfully
- `docker compose up -d && curl localhost:8080/api/health` — returns healthy
- GitHub Actions workflow files pass `actionlint` (if available)
- Zero telemetry: container makes no outbound requests
## Tasks
- [x] **T01: Dockerfile + .dockerignore** `est:30m`
- Why: The core deliverable — package everything into a production image.
- Files: `Dockerfile`, `.dockerignore`
- Do: Multi-stage build: (1) Node stage builds frontend, (2) Python stage installs backend deps, (3) Runtime stage copies built assets + installed packages. Use python:3.12-slim as base. Install yt-dlp + ffmpeg. Configure uvicorn entrypoint. Add HEALTHCHECK instruction.
- Verify: `docker build -t media-rip .` succeeds
- Done when: Image builds, contains frontend dist + backend + yt-dlp + ffmpeg
- [x] **T02: Docker Compose configs** `est:20m`
- Why: Zero-config startup and secure deployment example.
- Files: `docker-compose.yml`, `docker-compose.example.yml`
- Do: Basic compose: single service, port 8080, /downloads and /themes volumes. Example compose: add Caddy sidecar with auto-TLS, admin enabled. Add .env.example with documented variables.
- Verify: Compose file valid (docker compose config)
- Done when: Both compose files parse correctly, volumes and ports mapped
- [x] **T03: GitHub Actions CI workflow** `est:20m`
- Why: Automated quality gates on every PR.
- Files: `.github/workflows/ci.yml`
- Do: Trigger on PR to main. Jobs: backend lint (ruff) + test (pytest), frontend lint (vue-tsc) + test (vitest) + build. Use matrix for parallel execution. Cache pip and npm.
- Verify: Workflow YAML is valid
- Done when: CI workflow covers lint + test + build for both stacks
- [x] **T04: GitHub Actions Release workflow** `est:20m`
- Why: Tag-triggered build and push to container registries.
- Files: `.github/workflows/release.yml`
- Do: Trigger on tag v*. Build multi-arch (amd64, arm64) via docker buildx. Push to GHCR. Create GitHub Release with auto-generated notes. Cache Docker layers.
- Verify: Workflow YAML is valid
- Done when: Release workflow builds and pushes on tag
- [x] **T05: Final integration + docs** `est:20m`
- Why: Verify everything works end-to-end and document for operators.
- Files: `README.md`
- Do: Write README with quickstart, configuration, theme customization, admin setup, deployment. Verify Docker build. Run full test suites one final time.
- Verify: All tests pass, Docker builds, README is complete
- Done when: Project is ship-ready with documentation
## Files Likely Touched
- `Dockerfile`
- `.dockerignore`
- `docker-compose.yml`
- `docker-compose.example.yml`
- `.env.example`
- `.github/workflows/ci.yml`
- `.github/workflows/release.yml`
- `README.md`

View file

@ -0,0 +1,65 @@
---
id: S06
milestone: M001
status: complete
tasks_completed: 5
tasks_total: 5
test_count_backend: 182
test_count_frontend: 29
started_at: 2026-03-18
completed_at: 2026-03-18
---
# S06: Docker + CI/CD — Summary
**Delivered production Docker image, zero-config and secure compose configs, CI/CD GitHub Actions, SPA static serving, and full README documentation. 211 total tests pass across backend and frontend.**
## What Was Built
### Dockerfile (T01)
- Multi-stage build: Node 20 (frontend build) → Python 3.12 (pip install) → python:3.12-slim (runtime)
- Runtime includes: ffmpeg, curl, yt-dlp (latest stable)
- HEALTHCHECK instruction using `/api/health`
- OCI labels for image metadata
- Volumes: /downloads, /themes, /data
- Environment defaults for all config via MEDIARIP__ prefix
### Docker Compose (T02)
- `docker-compose.yml`: zero-config, single service, port 8080:8000
- `docker-compose.example.yml`: Caddy sidecar with auto-TLS for production
- `Caddyfile`: simple reverse proxy config
- `.env.example`: documented environment variables
### CI Workflow (T03)
- Triggers on PR and push to main/master
- Parallel jobs: backend (ruff lint + pytest), frontend (vue-tsc + vitest + build)
- Docker smoke test: build image, run, curl health endpoint
- pip + npm caching for fast CI
### Release Workflow (T04)
- Triggers on v* tags
- Multi-arch build: linux/amd64 + linux/arm64 via buildx + QEMU
- Pushes to GHCR with semver tags (v1.0.0, v1.0, v1, latest)
- Creates GitHub Release with auto-generated notes
- Docker layer caching via GitHub Actions cache
### README + Integration (T05)
- Quickstart, configuration table, session modes, custom theme guide
- Secure deployment instructions with Caddy
- API endpoint reference table
- Development setup for both stacks
- SPA catch-all route in FastAPI for client-side routing
- `requirements.txt` with pinned production dependencies
## Files Created
- `Dockerfile` — multi-stage production build
- `.dockerignore` — excludes dev files from build context
- `docker-compose.yml` — zero-config compose
- `docker-compose.example.yml` — secure deployment with Caddy
- `Caddyfile` — reverse proxy config
- `.env.example` — documented env vars
- `.github/workflows/ci.yml` — CI pipeline
- `.github/workflows/release.yml` — release pipeline
- `README.md` — full documentation
- `backend/requirements.txt` — pinned Python deps