FROM python:3.10-slim WORKDIR /app RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential && rm -rf /var/lib/apt/lists/* # Install Python dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy all source COPY . . ENV PYTHONPATH="/app:/app/engines" ENV HF_SPACE="1" # Numba JIT disk cache — persists compiled kernels within the container # lifecycle so only the first warmup pays compilation cost. ENV NUMBA_CACHE_DIR="/tmp/numba_cache" EXPOSE 7860 CMD ["python", "app.py"]