FROM python:3.10-slim RUN apt-get update && apt-get install -y libgomp1 && rm -rf /var/lib/apt/lists/* WORKDIR /app # Set writable paths for caches ENV MPLCONFIGDIR=/tmp/matplotlib ENV HF_HOME=/tmp/hf_cache ENV TRANSFORMERS_CACHE=/tmp/hf_cache ENV XDG_CACHE_HOME=/tmp/cache # Create cache directories and give full permissions RUN mkdir -p /tmp/hf_cache /tmp/cache /tmp/matplotlib \ && chmod -R 777 /tmp/hf_cache /tmp/cache /tmp/matplotlib COPY requirements.txt . RUN pip install --upgrade pip RUN pip install --no-cache-dir -r requirements.txt COPY main.py . COPY frontend ./frontend EXPOSE 8000 ENV PYTHONUNBUFFERED=1 CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]