File size: 1,054 Bytes
521addf
e65a8eb
 
 
 
 
 
 
521addf
e65a8eb
 
521addf
e65a8eb
 
 
 
 
 
521addf
 
 
e65a8eb
 
521addf
e65a8eb
521addf
 
 
e65a8eb
 
34aa914
 
 
 
521addf
e65a8eb
 
521addf
e65a8eb
 
521addf
 
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
33
34
35
36
37
38
39
40
41
42
43
# Use Python 3.9 base image
FROM python:3.9-slim

# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1 \
    PORT=7860

# Set working directory
WORKDIR /app

# Install system dependencies including ffmpeg
RUN apt-get update && apt-get install -y --no-install-recommends \
    ffmpeg \
    git \
    curl \
    libgl1-mesa-glx \
    libglib2.0-0 \
    libsm6 \
    libxrender1 \
    libxext6 \
    && rm -rf /var/lib/apt/lists/*

# Copy requirements.txt
COPY requirements.txt .

# Upgrade pip to avoid version issues and install dependencies
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt

# Create necessary directories with appropriate permissions
RUN mkdir -p /app/cache /app/uploads /app/results /app/checkpoints /app/temp && chmod -R 777 /app/cache /app/uploads /app/results /app/checkpoints /app/temp
RUN chmod -R 777 /app

# Copy app files
COPY . .

# Expose port for Hugging Face
EXPOSE 7860

# Start the Flask app with Gunicorn
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]