Repository navigation
Description
Task
T-005a· Milestone M1 — Foundation · Size S · Priority P1 · Epic #1Implements NFR-DEP-002 · NFR-SEC-002
Branch
ci/t-005a-backend-container-image-multi-stage— one task = one branch = one PR (doc 32 §6)
Summary
Create docker/backend.Dockerfile producing one image used for migrate, api, orchestrator and worker-k2d services.
Context / motivation
One image for every environment, configured only via env/secret files (NFR-DEP-002), is the basis of make up and the release flow.
Scope
In scope
- Multi-stage build: builder with
uv sync --locked --no-dev --extra api --extra worker --extra ml, runtimepython:3.12-slim(digest-pinned). - Non-root user
roboprobe(uid 10001),WORKDIR /app,/data/artifactsvolume mount point. ENTRYPOINT ["roboprobe"]; no default command (compose chooses).- OCI labels (source, revision, version) via build args.
.dockerignore.
Implementation guidance
- Use
--mount=type=cache,target=/root/.cache/uv. CPU-only torch wheels (index from T-001). Keep image small: no compilers in runtime stage.HEALTHCHECKdefined per service in compose, not in the image. - Standards: respect the layering contracts (doc 16 §2) and conventions in doc 34; no hard-coded tunables — thresholds/defaults come from typed settings (doc 27); no magic numbers (ruff
PLR2004); public APIs typed (mypy strict) and documented.
Acceptance criteria
-
docker build -f docker/backend.Dockerfile .succeeds;docker run --rm <img> --versionprints the version. - Container runs as non-root (
id -u≠ 0). - Image has no secrets baked in (checked with
docker history). - Tests listed below added and green in CI; coverage of new code meets the gate in doc 18 §3.
- Docs, config reference and CHANGELOG
Unreleasedupdated where behaviour, keys or interfaces changed. - Definition of Done (doc 32 §3) satisfied.
Tests required
- CI smoke step (added in T-119) runs
--version; local verification noted in PR.
Dependencies
Blocked by: #12 (T-001)
Blocks: #27 (T-005b), #189 (T-119), #58 (T-090)
Parallelization notes
Files / paths owned by this task — avoid editing other paths; shared files (pyproject.toml entry points, cli/main.py, api/routers/__init__.py, router.tsx, docker/compose.yaml, ci.yml) are append-only:
docker/backend.Dockerfile.dockerignore
Independent of T-005b until compose references the image.
Definition of Done
Per doc 32 §3 and AGENTS.md §5: lint, format, mypy strict and import-linter green; tests added and passing; docs updated; PR template completed with Closes #<this issue>; Conventional Commit messages referencing T-005a (doc 16 §6); commits authored only by the repository owner identity (AGENTS.md §4); CI green; reviewer checklist (doc 32 §5.1) satisfied.
References
Design docs: doc 17 §5 · doc 21 §1 · ADR-0013
Requirements: NFR-DEP-002 · NFR-SEC-002 (traceability: doc 28)
External:
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsDone
Activity
coreprofile: Postgres 17 with secrets, migrate placeholder, make up/down/db-up #27images.yml: build & push to GHCR, Trivy scan, SBOM (Syft), provenance #189CodewithJha commentedon Nov 19, 2026
Implemented in #244.