Spaces:
Sleeping
Sleeping
File size: 988 Bytes
db2860e 7701a69 db2860e ad44313 db2860e c3fa9e8 7701a69 c3fa9e8 db2860e c3fa9e8 8c89a51 db2860e 86f5464 db2860e 211d87b 536344a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# 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"] |