Skip to content

Docker credit builds must COPY unused sibling investing/pyproject.toml (uv workspace) #188

Open

Description

@cursor

This was generated by AI during triage.

Problem

Credit Docker images install only the credit package (uv sync --frozen --no-dev --package credit), but the Dockerfiles still COPY investing/pyproject.toml into the image so the uv workspace lock can resolve.

That sibling metadata is not used at runtime for credit scoring/serving — it is only there because the root uv.lock lists both workspace members. As more domains appear (e.g. fraud), this pattern forces every domain image to COPY every other member's pyproject.toml, which does not scale and violates “image contains only what it needs.”

Evidence (develop)

  • credit/Dockerfile
  • credit/Dockerfile.serve
  • credit/Dockerfile.serve.demo

Pattern:

COPY pyproject.toml uv.lock README.md ./
COPY credit ./credit
# Workspace lockfile needs sibling member metadata present.
COPY investing/pyproject.toml investing/pyproject.toml
RUN uv sync --frozen --no-dev --package credit --no-editable

Related: uv workspace adoption #182 / PR #187; lean domain deps #183 (lean split does not remove the sibling COPY).

Desired outcome

Credit (and future domain) Docker builds should not need unused sibling domain metadata in the image. Acceptable directions (decide in triage):

  1. Build context / Dockerfile layout that only materializes members needed for that image.
  2. Shared workspace package + topology that does not force every sibling into every image.
  3. Separate lock / non-workspace install path for production images (document tradeoffs).
  4. Other uv-supported pattern that keeps one monorepo without shipping dead member files.

Out of scope for this issue

  • Implementing lean credit vs investing dependency lists (#183) — that PR should keep documenting the leftover COPY, not “fix” it.

Acceptance ideas

  • Credit Dockerfiles no longer COPY investing/pyproject.toml (or equivalent unused siblings).
  • docker build -f credit/Dockerfile … still succeeds with uv sync --package credit.
  • Document the chosen pattern for the next domain (fraud) so we do not reintroduce sibling COPYs.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions