File size: 712 Bytes
60b07c5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Start with a lightweight Python image
FROM python:3.9-slim

# Install FFmpeg (Required for MoviePy/Video processing)
RUN apt-get update && \
    apt-get install -y ffmpeg && \
    rm -rf /var/lib/apt/lists/*

# Set working directory
WORKDIR /app

# Install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Create necessary directories and set permissions so the app can write to them
RUN mkdir -p uploads user_files && \
    chmod 777 uploads user_files

# Copy the rest of the app code
COPY . .

# Expose the standard Hugging Face port
EXPOSE 7860

# Run the app with Gunicorn for stability
CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app", "--timeout", "300"]