File size: 978 Bytes
e6a2825
ec3e1d8
 
 
 
e6a2825
 
ec3e1d8
e6a2825
 
 
 
ec3e1d8
e6a2825
 
 
 
 
 
ec3e1d8
 
 
e6a2825
ec3e1d8
 
 
e6a2825
ec3e1d8
 
e6a2825
ec3e1d8
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
# Use a slim Python base
FROM python:3.10-slim

ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# increase pip timeout to help larger downloads (optional)
ENV PIP_DEFAULT_TIMEOUT=1200

# Install system deps (ffmpeg + build deps)
RUN apt-get update && apt-get install -y --no-install-recommends \
    ffmpeg git build-essential curl libsm6 libxext6 libgl1 \
    && rm -rf /var/lib/apt/lists/*

# Install CPU-only PyTorch wheel first (smaller & reliable)
# This installs a stable CPU build of torch & torchvision from official index
RUN pip install --no-cache-dir --upgrade pip \
 && pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu

# Copy requirements and install everything else (do NOT include torch here)
COPY requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt

# Copy app and set workdir
COPY . /app
WORKDIR /app

# Expose HF default port
ENV PORT=7860

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