File size: 776 Bytes
707f206
2d2da12
 
707f206
2d2da12
 
707f206
2eea5a6
2d2da12
 
 
 
 
2eea5a6
 
2d2da12
 
707f206
 
2d2da12
707f206
2d2da12
707f206
 
2d2da12
 
707f206
 
 
 
 
2d2da12
707f206
 
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
# Use official Python image
FROM python:3.12-slim

# Set work directory
WORKDIR /app

# Install system dependencies for OpenCV and FFmpeg
# libgl1-mesa-glx replaced with libgl1 in newer Debian
RUN apt-get update && apt-get install -y \
    build-essential \
    ffmpeg \
    libsm6 \
    libxext6 \
    libgl1 \
    libglib2.0-0 \
    && rm -rf /var/lib/apt/lists/*

# Copy requirements first (better caching)
COPY requirements.txt /app/

# Upgrade pip
RUN pip install --no-cache-dir --upgrade pip

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

# Copy all other files
COPY . /app

# Expose port 7860 (HF Spaces requirement)
EXPOSE 7860

# Command to run FastAPI on port 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]