Spaces:
Sleeping
Sleeping
| # Dockerfile | |
| # Use an official Python runtime as a parent image | |
| FROM python:3.11 | |
| # Set the working directory in the container | |
| WORKDIR /app | |
| # Set a writable cache directory for Hugging Face models | |
| ENV HF_HOME=/app/cache | |
| ENV TRANSFORMERS_CACHE=/app/cache | |
| # Copy and install requirements first to leverage Docker layer caching | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # --- FIX: Create the cache directory and set its permissions --- | |
| # This ensures the directory exists and is writable by any user. | |
| RUN mkdir -p /app/cache && \ | |
| chmod -R 777 /app/cache | |
| RUN apt-get update && apt-get install -y ffmpeg \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy the rest of your application code into the container | |
| COPY . . | |
| # Make port 7860 available to the world outside this container | |
| EXPOSE 7860 | |
| # Command to run your application using gunicorn with eventlet for SocketIO | |
| CMD ["gunicorn", "--worker-class", "eventlet", "--bind", "0.0.0.0:7860", "app.app:app"] |