FROM python:3.9-slim # Set Hugging Face cache to a writable directory ENV TRANSFORMERS_CACHE=/tmp/hf ENV HF_HOME=/tmp/hf # Install build essentials and clean up RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ && rm -rf /var/lib/apt/lists/* WORKDIR /app # Install Python dependencies COPY requirements.txt requirements.txt RUN pip install --no-cache-dir -r requirements.txt # Copy application files COPY main.py main.py COPY app.py app.py CMD ["python", "main.py"]