Spaces:
Runtime error
Runtime error
| # Use a slim base image | |
| FROM python:3.10-slim | |
| # Install dependencies | |
| RUN apt-get update && \ | |
| apt-get install -y git && \ | |
| rm -rf /var/lib/apt/lists/* | |
| # Optional: copy requirements file and install | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy your app code into the container | |
| WORKDIR /app | |
| COPY app.py /app/app.py | |
| # Create a writable cache directory | |
| RUN mkdir -p /app/cache | |
| # Set environment variables for cache and disable root cache attempts | |
| ENV TRANSFORMERS_CACHE=/app/cache | |
| ENV HF_HOME=/app/cache | |
| # Expose port (for Gradio/Streamlit etc.) | |
| EXPOSE 7860 | |
| # Launch your app | |
| CMD ["python", "app.py"] |