File size: 890 Bytes
b11a5e9
 
 
 
 
 
 
aee5df5
b11a5e9
 
 
 
a6147bc
 
34337a4
a6147bc
aee5df5
 
 
a6147bc
b11a5e9
 
 
 
 
 
 
e8c25e9
 
 
b11a5e9
 
e8c25e9
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
FROM python:3.10-slim

WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y \
    git \
    libgomp1 \
    && rm -rf /var/lib/apt/lists/*

# Copy requirements and install Python packages
COPY requirements.txt .
# Install dependencies (prefer binaries to avoid builds)
RUN pip install --no-cache-dir --upgrade pip setuptools wheel
# Install torch from CPU wheels explicitly to avoid source builds
RUN pip install --no-cache-dir --prefer-binary \
    torch==2.2.2 \
    --index-url https://download.pytorch.org/whl/cpu \
    --extra-index-url https://pypi.org/simple
RUN pip install --no-cache-dir --prefer-binary -r requirements.txt

# Copy application code
COPY . .

# Expose port 7860 (Gradio default)
EXPOSE 7860

# Runtime env (logging + Gradio bind)
ENV PYTHONUNBUFFERED=1 \
    GRADIO_SERVER_NAME="0.0.0.0"

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