fix(api): install cli extra bundle in image — bare sync shipped no uvicorn
All checks were successful
CI / lint (push) Successful in 37s
CI / notebooks-smoke (push) Successful in 1m26s
Deploy / notebooks (push) Has been skipped
Deploy / zotero (push) Has been skipped
Deploy / docs (push) Has been skipped
Deploy / api (push) Successful in 1m17s
Deploy / mc (push) Has been skipped
Infra CI / notebooks (push) Successful in 46s
Infra CI / zotero (push) Successful in 15s
Infra CI / docs (push) Successful in 12s
Infra CI / api (push) Successful in 12s
Infra CI / mc (push) Successful in 18s
Deploy / report (push) Successful in 12s
CI / test (push) Successful in 13m49s

First rebuild in 3 months surfaced this: pyproject moved uvicorn/
fastapi/aco/bib into extras since the last api image build, so
'uv sync --no-dev' produced a venv with base deps only and the
container crash-looped on 'Failed to spawn: uvicorn'. infra-ci builds
the image but nothing boots it, so the break was invisible until a
real deploy.
This commit is contained in:
kert
2026-07-10 13:50:30 -04:00
parent 9b58e2dfb2
commit 81dba5ef2a

View File

@@ -16,12 +16,17 @@ RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-reco
COPY pyproject.toml uv.lock README.md ./
COPY src/ src/
# Install the package (no dev deps)
# Install the package (no dev deps). The server needs the cli extra
# bundle (aco + api + bib + mail): uvicorn/fastapi/pyjwt live in the
# api extra, and /health imports aco.pipe + bib.store + duckdb — a
# bare `uv sync --no-dev` installs none of them (base deps only),
# which shipped an image that crash-looped on `Failed to spawn:
# uvicorn`.
ENV UV_PYTHON_PREFERENCE=only-system \
UV_LINK_MODE=copy \
UV_PROJECT_ENVIRONMENT=.venv \
UV_INDEX_URL=${PYPI_INDEX_URL}
RUN uv sync --no-dev && uv pip install -e .
RUN uv sync --no-dev --extra cli && uv pip install -e .
# Config
COPY stack.toml ./