-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.agent
More file actions
40 lines (32 loc) · 1.36 KB
/
Dockerfile.agent
File metadata and controls
40 lines (32 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
FROM mcr.microsoft.com/mirror/docker/library/python:3.11-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
gcc \
curl \
&& rm -rf /var/lib/apt/lists/*
# Install uv
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
ENV PATH="/root/.local/bin:/root/.cargo/bin:$PATH"
# Copy project files
COPY pyproject.toml .
COPY src/ src/
COPY config/ config/
COPY .env* ./
# Install dependencies (no torch/docling — use pymupdf4llm with markitdown fallback)
RUN uv pip install --system ".[pymupdf4llm]"
# Download spaCy NER models.
# - en_core_web_sm: used by mem0 fact extraction; without it the backend logs
# "Failed to load spaCy full model" on every request and mem0 degrades to
# keyword-only. ~50MB unpacked.
# - es_core_news_sm: used by the Patient Vault PII anonymiser to scrub
# PERSON/ORG/GPE entities out of Spanish clinical documents before they
# reach the LLM (Matucha is Spanish-first; regex alone doesn't catch names
# or hospitals). ~40MB unpacked.
RUN python -m spacy download en_core_web_sm \
&& python -m spacy download es_core_news_sm
# Set python path, prevent bytecache issues when host mounts differ
ENV PYTHONPATH=/app/src
ENV PYTHONDONTWRITEBYTECODE=1
# Default command — override with --role and --port in docker-compose
CMD ["python", "-m", "interfaces.agent_server", "--role", "echo", "--port", "8005"]