- Introduced memory snapshot logging to track resource usage during summarization and diarization processes. - Added action item extraction capabilities from meeting segments, improving the summarization output. - Refactored summarization and diarization mixins to integrate new logging and extraction functionalities. - Implemented a bounded audio buffer for streaming diarization to manage memory efficiently. - Enhanced error handling and diagnostics in summarization and diarization workflows.
92 lines
3.2 KiB
Docker
92 lines
3.2 KiB
Docker
# syntax=docker/dockerfile:1
|
|
FROM python:3.12-bookworm AS base
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1 \
|
|
UV_COMPILE_BYTECODE=1 \
|
|
UV_LINK_MODE=copy
|
|
|
|
# Install uv
|
|
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
|
|
|
|
# Core build/runtime deps for project packages (sounddevice, asyncpg, cryptography).
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends \
|
|
build-essential \
|
|
pkg-config \
|
|
portaudio19-dev \
|
|
libsndfile1 \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /workspace
|
|
|
|
# Copy dependency files first for better layer caching
|
|
COPY pyproject.toml uv.lock* ./
|
|
|
|
# =============================================================================
|
|
# Server Stage
|
|
# =============================================================================
|
|
FROM base AS server
|
|
|
|
# Install dependencies (server needs dev deps for watchfiles)
|
|
RUN --mount=type=cache,target=/root/.cache/uv \
|
|
uv sync --frozen --no-install-project --group dev --all-extras
|
|
|
|
# Copy source code
|
|
COPY . .
|
|
|
|
# Install the project itself
|
|
RUN --mount=type=cache,target=/root/.cache/uv \
|
|
uv sync --frozen --group dev --all-extras
|
|
|
|
# Install spaCy small English model for NER (baked into image)
|
|
RUN --mount=type=cache,target=/root/.cache/uv \
|
|
uv pip install https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.8.0/en_core_web_sm-3.8.0-py3-none-any.whl
|
|
|
|
EXPOSE 50051
|
|
|
|
CMD ["sh", "-c", "uv sync --frozen --group dev --all-extras && uv run python scripts/dev_watch_server.py"]
|
|
|
|
# =============================================================================
|
|
# Server Production Stage (all optional dependencies)
|
|
# =============================================================================
|
|
FROM base AS server-full
|
|
|
|
# Install all dependencies including optional extras
|
|
RUN --mount=type=cache,target=/root/.cache/uv \
|
|
uv sync --frozen --no-install-project --group dev --all-extras
|
|
|
|
# Copy source code
|
|
COPY . .
|
|
|
|
# Install the project itself
|
|
RUN --mount=type=cache,target=/root/.cache/uv \
|
|
uv sync --frozen --group dev --all-extras
|
|
|
|
# Install spaCy small English model for NER (baked into image)
|
|
RUN --mount=type=cache,target=/root/.cache/uv \
|
|
uv pip install https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.8.0/en_core_web_sm-3.8.0-py3-none-any.whl
|
|
|
|
EXPOSE 50051
|
|
|
|
CMD ["sh", "-c", "uv sync --frozen --group dev --all-extras && uv run python scripts/dev_watch_server.py"]
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# NER stage: Add spaCy model for named entity recognition
|
|
# -----------------------------------------------------------------------------
|
|
FROM base AS with-ner
|
|
|
|
# Install NER dependencies and download spaCy model
|
|
RUN python -m pip install -e ".[ner]" \
|
|
&& python -m spacy download en_core_web_sm
|
|
|
|
# Verify model is available
|
|
RUN python -c "import spacy; nlp = spacy.load('en_core_web_sm'); print('NER model loaded successfully')"
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# Development target (default)
|
|
# -----------------------------------------------------------------------------
|
|
FROM base AS dev
|
|
|
|
CMD ["sh", "-c", "uv sync --frozen --group dev --all-extras && uv run python scripts/dev_watch_server.py"]
|