Spaces:
Running
Running
FROM python:3.10-bullseye | |
# Avoid interactive prompts during apt installs | |
ENV DEBIAN_FRONTEND=noninteractive | |
# --- 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 | |
# --- Copy requirements and install Python dependencies --- | |
COPY requirements.txt /app/requirements.txt | |
RUN pip install --no-cache-dir --upgrade pip && \ | |
pip install --no-cache-dir -r /app/requirements.txt | |
# --- Copy application code --- | |
WORKDIR /app | |
COPY . /app | |
# --- Environment variables for HF + Transformers --- | |
ENV HF_HUB_DISABLE_TELEMETRY=1 \ | |
HF_HUB_ENABLE_HF_TRANSFER=1 \ | |
TOKENIZERS_PARALLELISM=false | |
# --- Expose default Gradio port --- | |
EXPOSE 7860 | |
# Create model_cache and tmp with proper ownership | |
RUN mkdir -p /app/model_cache /app/tmp && chown -R 1000:1000 /app | |
# --- Run app --- | |
CMD ["python", "app.py"] |