- Bump requires-python to >=3.14 and ruff target-version to py314 - Switch all service images to uv:python3.14-trixie-slim builder and python:3.14-slim-trixie runtime - Rename libmagic1 -> libmagic1t64 in worker-extract for Trixie - Regenerate uv.lock under Python 3.14 - Update ARCHITECTURE.md to reflect py3.14 + Trixie
39 lines
1.2 KiB
Docker
39 lines
1.2 KiB
Docker
# syntax=docker/dockerfile:1
|
|
|
|
# ─── Stage 1: build deps + project into a venv via uv ─────────────────────────
|
|
FROM ghcr.io/astral-sh/uv:python3.14-trixie-slim AS builder
|
|
|
|
ENV UV_COMPILE_BYTECODE=1 \
|
|
UV_LINK_MODE=copy \
|
|
UV_PYTHON_DOWNLOADS=never \
|
|
UV_PROJECT_ENVIRONMENT=/app/.venv
|
|
|
|
WORKDIR /app
|
|
|
|
COPY pyproject.toml uv.lock ./
|
|
COPY README.md ./
|
|
COPY alembic.ini ./
|
|
COPY migrations ./migrations
|
|
|
|
# Install only the api group (core + db/mq/s3/obs + fastapi/uvicorn).
|
|
RUN --mount=type=cache,target=/root/.cache/uv \
|
|
uv sync --frozen --no-default-groups --group api --no-install-project
|
|
|
|
# ─── Stage 2: lean runtime ─────────────────────────────────────────────────
|
|
FROM python:3.14-slim-trixie
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1 \
|
|
PATH=/app/.venv/bin:$PATH
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=builder /app/.venv /app/.venv
|
|
|
|
# App source: internal imports use the absolute `src.contract_check.*` form.
|
|
COPY src ./src
|
|
COPY alembic.ini ./
|
|
COPY migrations ./migrations
|
|
|
|
EXPOSE 8000 9100
|
|
CMD ["python", "-m", "src.contract_check.api"]
|