File size: 1,035 Bytes
a6e6cf6
8746765
135639b
 
 
 
a6e6cf6
135639b
 
 
 
 
 
 
 
 
 
7f0a276
 
 
135639b
8746765
135639b
 
 
8746765
135639b
8746765
 
135639b
8746765
 
135639b
 
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 nvidia/cuda:12.1.0-base-ubuntu22.04

# Prevent interactive prompts during apt installs
ENV DEBIAN_FRONTEND=noninteractive

# Install Python 3.11, pip, and minimal build tools
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
        python3.11 \
        python3.11-venv \
        python3.11-dev \
        python3-pip \
        build-essential \
        libevent-dev \
    && python3.11 -m pip install --upgrade pip setuptools wheel \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Copy dependency list and install using Python 3.11 explicitly
COPY requirements.txt .
RUN python3.11 -m pip install --no-cache-dir -r requirements.txt \
    && python3.11 -c "import eventlet; print('eventlet version:', eventlet.__version__)" \
    && rm -rf ~/.cache/pip

# Copy source code last (better layer caching)
COPY . .

# Expose the port expected by Hugging Face Spaces
EXPOSE 7860

# Run the app explicitly with Python 3.11 to avoid system default mismatches
CMD ["python3.11", "app.py"]