FROM python:3.10-slim # Set environment variables ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 ENV HF_HOME=/code/.cache/huggingface ENV TRANSFORMERS_CACHE=/code/.cache/huggingface # Set work directory WORKDIR /code # Install system dependencies RUN apt-get update && apt-get install -y build-essential # Install Python dependencies COPY requirements.txt /code/ RUN pip install --upgrade pip RUN pip install --no-cache-dir -r requirements.txt # Copy project files COPY . /code/ # Expose port EXPOSE 7860 RUN mkdir -p /code/.cache/huggingface && chmod -R 777 /code/.cache # Run the app CMD ["python", "app.py"]