File size: 1,074 Bytes
d8da444
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Use the official Python image as base
FROM python:3.10-slim

# Avoid prompts during builds
ARG CACHEBUST=1
ENV DEBIAN_FRONTEND=noninteractive

# Set workdir
WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y \

    git \
    build-essential \
    ffmpeg \
    libglib2.0-0 \
    libsm6 \
    libxext6 \
    libxrender-dev \
    && rm -rf /var/lib/apt/lists/*

# Upgrade pip and install build tools early to avoid CLIP build issues
RUN pip install --upgrade pip setuptools wheel build

# Preinstall OpenAI CLIP from GitHub to avoid setup.py error
RUN pip install git+https://github.com/openai/CLIP.git

# Copy the rest of your dependencies
COPY requirements.txt .

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

# Copy your app code (optional - assuming you have app.py or similar)
COPY . .

# Expose gradio on port 7860 (Hugging Face auto-detects this)
EXPOSE 7860

# Start Gradio app (adjust this if your main file is different)
CMD ["python", "app.py"]