17 lines
447 B
Docker
17 lines
447 B
Docker
FROM python:3.12-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# Install dependencies first (cache layer)
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Pre-download default model into the image
|
|
ARG EMBEDDING_MODEL=all-MiniLM-L6-v2
|
|
RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('${EMBEDDING_MODEL}')"
|
|
|
|
COPY main.py .
|
|
|
|
EXPOSE 8001
|
|
|
|
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8001"]
|