# Hugging Face Docker Spaces base image FROM python:3.10-slim # ------------------------------------------------- # System dependencies # ------------------------------------------------- RUN apt-get update && apt-get install -y \ git \ build-essential \ wget \ && rm -rf /var/lib/apt/lists/* # ------------------------------------------------- # Environment variables # ------------------------------------------------- ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 ENV TRANSFORMERS_CACHE=/data/.cache/huggingface ENV HF_HOME=/data/.cache/huggingface ENV NLTK_DATA=/data/nltk_data # ------------------------------------------------- # Create working directory # ------------------------------------------------- WORKDIR /app # ------------------------------------------------- # Install Python dependencies # ------------------------------------------------- COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # ------------------------------------------------- # Pre-download NLTK resources (avoid runtime downloads) # ------------------------------------------------- RUN python - <