File size: 962 Bytes
a25898b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Use official Python 3.11 image
FROM python:3.11.4-slim

# Avoid prompts during builds
ENV DEBIAN_FRONTEND=noninteractive

# Set working directory
WORKDIR /app

# Install system-level 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 to avoid wheel issues
RUN pip install --upgrade pip setuptools wheel build

# Install OpenAI CLIP from GitHub directly (outside requirements.txt)
RUN pip install git+https://github.com/openai/CLIP.git

# Copy and install remaining Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of the app (e.g., app.py, assets, etc.)
COPY . .

# Expose Gradio’s default port
EXPOSE 7860

# Start the app (update this if your entry file is named differently)
CMD ["python", "app.py"]