| |
| FROM python:3.12-slim |
|
|
| |
| WORKDIR /app |
|
|
| ENV TRANSFORMERS_CACHE=/tmp/.cache |
| RUN mkdir -p /tmp/.cache && chmod -R 777 /tmp/.cache |
|
|
| |
| RUN apt-get update && apt-get install -y \ |
| build-essential \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| COPY requirements.txt . |
| RUN pip install --no-cache-dir -r requirements.txt |
|
|
| |
| RUN python -c "from langchain_community.embeddings import HuggingFaceEmbeddings; HuggingFaceEmbeddings(model_name='sentence-transformers/all-MiniLM-L6-v2')" |
|
|
| |
| COPY . . |
|
|
| |
| EXPOSE 7860 |
|
|
| |
| CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"] |
|
|