File size: 895 Bytes
e4aef33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM pytorch/pytorch:2.8.0-cuda12.9-cudnn9-runtime

ENV PYTHONUNBUFFERED=1

RUN useradd -m -u 1000 user
WORKDIR /app

# Install system dependencies for building Python packages
RUN apt-get update && apt-get install -y \
    build-essential \
    libffi-dev \
    libssl-dev \
    ffmpeg \
    libsm6 \
    libxext6 \
    libmagic1 \
    && rm -rf /var/lib/apt/lists/*


# Create virtual environment for Sly (keep isolated)
RUN python -m venv /app/.venv-sly
RUN /app/.venv-sly/bin/pip install --upgrade pip
COPY --chown=user requirements-sly.txt requirements-sly.txt
RUN /app/.venv-sly/bin/pip install -r requirements-sly.txt

# Install Gradio and other dependencies
RUN pip install --upgrade pip
COPY --chown=user requirements.txt requirements.txt
RUN pip install -r requirements.txt


# Copy the rest of the app
COPY --chown=user . .

ENV GRADIO_SERVER_NAME="0.0.0.0"

CMD ["python", "app.py"]