DealDocumentScreening/srv/worker-analyze/Dockerfile
febux f24117c2d1 build: upgrade to Python 3.14 on Debian Trixie
- 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
2026-09-06 15:29:49 +03:00

36 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 ./
# Install only the analyze group (core + db/mq/s3/obs + otel-httpx). No
# tesseract/pymupdf — this image is the leanest LLM/I/O worker.
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --no-default-groups --group analyze --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
EXPOSE 9102
CMD ["python", "-m", "src.contract_check.worker_analyze"]