FROM python:3.10-slim WORKDIR /app # System deps RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential git curl && \ rm -rf /var/lib/apt/lists/* # Python deps COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # App COPY . . # Cache tokenizer (optional) RUN python -c "from transformers import AutoTokenizer; AutoTokenizer.from_pretrained('mistralai/Mistral-7B-Instruct-v0.3')" ENV HF_HOME=/app/.cache/huggingface ENV TRANSFORMERS_CACHE=/app/.cache/huggingface EXPOSE 7860 CMD ["python", "app.py"]