-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (24 loc) · 1.1 KB
/
Copy pathDockerfile
File metadata and controls
32 lines (24 loc) · 1.1 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
# Starter Agent — container image
# Multi-stage-ish single stage kept simple for readability.
FROM python:3.11-slim
# System deps occasionally needed by onnxruntime (used by Chroma's embedder).
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Install Python deps first for better layer caching.
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy the application.
COPY agent ./agent
COPY tests ./tests
COPY README.md .
# Pre-warm the local embedding model so the container works OFFLINE on first
# request (downloads ~80MB MiniLM at build time instead of at runtime).
RUN python -c "from chromadb.utils import embedding_functions as ef; ef.DefaultEmbeddingFunction()(['warmup'])"
EXPOSE 8000
# Healthcheck hits the /health endpoint.
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD curl -fsS http://localhost:8000/health || exit 1
# Default: serve the API + web UI. Override CMD to run the CLI or tests.
CMD ["uvicorn", "agent.api:app", "--host", "0.0.0.0", "--port", "8000"]