Spaces:
Running
Running
FROM python:3.10-bullseye | |
ENV DEBIAN_FRONTEND=noninteractive \ | |
HF_HUB_DISABLE_TELEMETRY=1 \ | |
HF_HUB_ENABLE_HF_TRANSFER=1 \ | |
TOKENIZERS_PARALLELISM=false \ | |
PIP_DISABLE_PIP_VERSION_CHECK=1 \ | |
PIP_NO_CACHE_DIR=1 | |
# --- Install system dependencies --- | |
RUN apt-get update && apt-get install -y \ | |
ffmpeg \ | |
libgl1 \ | |
libglib2.0-0 \ | |
libsndfile1 \ | |
libsm6 \ | |
libxext6 \ | |
libxrender1 \ | |
git \ | |
git-lfs \ | |
cmake \ | |
rsync \ | |
&& rm -rf /var/lib/apt/lists/* \ | |
&& git lfs install | |
# --- Install Python build tools early for speed --- | |
RUN pip install --upgrade pip setuptools wheel | |
# --- Copy only requirements first for better caching --- | |
COPY requirements.txt /app/requirements.txt | |
# Install dependencies with faster resolution | |
RUN pip install --upgrade pip \ | |
&& pip install --prefer-binary --use-deprecated=legacy-resolver -r /app/requirements.txt | |
# --- Copy application code --- | |
WORKDIR /app | |
COPY . /app | |
# Create writable directories | |
RUN mkdir -p /app/model_cache /app/tmp && chown -R 1000:1000 /app | |
EXPOSE 7860 | |
CMD ["python", "app.py", "--api", "--host", "0.0.0.0", "--port", "7860"] | |