-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.api
More file actions
26 lines (25 loc) · 931 Bytes
/
Copy pathDockerfile.api
File metadata and controls
26 lines (25 loc) · 931 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
FROM python:3.11-slim AS builder
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential libgomp1 git \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
FROM python:3.11-slim AS runtime
WORKDIR /app
COPY --from=builder /usr/local/lib/python3.11 /usr/local/lib/python3.11
COPY --from=builder /usr/local/bin /usr/local/bin
RUN apt-get update && apt-get install -y --no-install-recommends libgomp1 curl \
&& rm -rf /var/lib/apt/lists/*
COPY . .
RUN mkdir -p data/chroma_db logs
ENV LLM_PROVIDER=ollama \
LLM_MODEL=llama3.2:3b \
OLLAMA_BASE_URL=http://ollama:11434 \
EMBEDDING_DEVICE=cpu \
API_HOST=0.0.0.0 \
API_PORT=8000 \
PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1
EXPOSE 8000
CMD ["sh", "-c", "uvicorn backend.api:app --host 0.0.0.0 --port ${PORT:-8000}"]