File size: 937 Bytes
96a796a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
42
# Use official PyTorch image with CUDA support
FROM pytorch/pytorch:2.1.0-cuda118-runtime

# Set working directory
WORKDIR /workspace

# Install system dependencies
RUN apt-get update && apt-get install -y \
    git \
    ffmpeg \
    libgl1 \
    libsm6 \
    libxext6 \
    cmake \
    build-essential \
    curl \
    && rm -rf /var/lib/apt/lists/*

# Optional: Install CUDA Toolkit (only needed if compiling from source)
RUN apt-get update && apt-get install -y --no-install-recommends \
    cuda-toolkit-11-8 && \
    ln -s /usr/local/cuda-11.8 /usr/local/cuda && \
    rm -rf /var/lib/apt/lists/*

ENV CUDA_HOME=/usr/local/cuda
ENV PATH=${PATH}:/usr/local/cuda/bin

# Copy requirements.txt
COPY requirements.txt .

# Install Python dependencies
RUN pip install --no-cache-dir -U pip && \
    pip install --no-cache-dir -r requirements.txt

# Copy app code
COPY . .

# Expose port
EXPOSE 7860

# Run the app
CMD ["python", "app.py"]