Spaces:
Running
Running
Upload Dockerfile
Browse files- Dockerfile +41 -0
Dockerfile
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use the official Python image as base
|
| 2 |
+
FROM python:3.10-slim
|
| 3 |
+
|
| 4 |
+
# Avoid prompts during builds
|
| 5 |
+
ARG CACHEBUST=1
|
| 6 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 7 |
+
|
| 8 |
+
# Set workdir
|
| 9 |
+
WORKDIR /app
|
| 10 |
+
|
| 11 |
+
# Install system dependencies
|
| 12 |
+
RUN apt-get update && apt-get install -y \
|
| 13 |
+
git \
|
| 14 |
+
build-essential \
|
| 15 |
+
ffmpeg \
|
| 16 |
+
libglib2.0-0 \
|
| 17 |
+
libsm6 \
|
| 18 |
+
libxext6 \
|
| 19 |
+
libxrender-dev \
|
| 20 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 21 |
+
|
| 22 |
+
# Upgrade pip and install build tools early to avoid CLIP build issues
|
| 23 |
+
RUN pip install --upgrade pip setuptools wheel build
|
| 24 |
+
|
| 25 |
+
# Preinstall OpenAI CLIP from GitHub to avoid setup.py error
|
| 26 |
+
RUN pip install git+https://github.com/openai/CLIP.git
|
| 27 |
+
|
| 28 |
+
# Copy the rest of your dependencies
|
| 29 |
+
COPY requirements.txt .
|
| 30 |
+
|
| 31 |
+
# Install remaining Python dependencies
|
| 32 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 33 |
+
|
| 34 |
+
# Copy your app code (optional - assuming you have app.py or similar)
|
| 35 |
+
COPY . .
|
| 36 |
+
|
| 37 |
+
# Expose gradio on port 7860 (Hugging Face auto-detects this)
|
| 38 |
+
EXPOSE 7860
|
| 39 |
+
|
| 40 |
+
# Start Gradio app (adjust this if your main file is different)
|
| 41 |
+
CMD ["python", "app.py"]
|