-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (27 loc) · 1019 Bytes
/
Copy pathDockerfile
File metadata and controls
41 lines (27 loc) · 1019 Bytes
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
41
# Dockerfile
# Multi-stage build for the FastAPI backend
FROM python:3.13-slim AS builder
WORKDIR /app
RUN apt-get update && \
apt-get install -y --no-install-recommends gcc g++ && \
rm -rf /var/lib/apt/lists/*
COPY pyproject.toml ./
RUN python -m venv /app/.venv && \
/app/.venv/bin/pip install --upgrade pip && \
/app/.venv/bin/pip install ".[dev]" \
langchain-chroma langchain-huggingface langchain-ollama \
langchain-text-splitters markdown
FROM python:3.13-slim AS runtime
WORKDIR /app
COPY --from=builder /app/.venv /app/.venv
ENV PATH="/app/.venv/bin:$PATH"
ENV PYTHONUNBUFFERED=1
COPY src/ ./src/
COPY data/ ./data/
COPY tests/ ./tests/
COPY pyproject.toml ./
RUN mkdir -p vectorstore evaluation_results
EXPOSE 8000
HEALTHCHECK --interval=30s --timeout=10s --retries=3 \
CMD python -c "import httpx; r = httpx.get('http://localhost:8000/health'); exit(0 if r.status_code == 200 else 1)"
CMD ["uvicorn", "src.api.main:app", "--host", "0.0.0.0", "--port", "8000"]