File size: 916 Bytes
16b97e8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM python:3.12-slim

# Avoid interactive prompts during build
ENV DEBIAN_FRONTEND=noninteractive

# Install system dependencies with libGL auto-detection
RUN apt-get update && apt-get install -y --no-install-recommends \
    git \
    git-lfs \
    ffmpeg \
    libsm6 \
    libxext6 \
    cmake \
    rsync \
    && if apt-cache show libgl1 >/dev/null 2>&1; then \
        apt-get install -y libgl1; \
    elif apt-cache show libgl1-mesa-glx >/dev/null 2>&1; then \
        apt-get install -y libgl1-mesa-glx; \
    else \
        echo "ERROR: Neither libgl1 nor libgl1-mesa-glx found" && exit 1; \
    fi \
    && rm -rf /var/lib/apt/lists/* \
    && git lfs install

# Copy dependency file & install Python packages
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy source code
COPY . /app
WORKDIR /app

# Default command (Gradio, Streamlit, or Python)
CMD ["python", "app.py"]