Sentient-Field/sgp-tribe3
0
1FROM python:3.11-slim2 3RUN apt-get update && apt-get install -y \4 ffmpeg git git-lfs libsndfile1 libgl1 \5 libglib2.0-0 wget espeak curl \6 && rm -rf /var/lib/apt/lists/*7 8WORKDIR /app9 10# Install uv (which provides uvx) — used by tribev2 for transcription11RUN curl -LsSf https://astral.sh/uv/install.sh | sh12ENV PATH="/root/.local/bin:$PATH"13 14RUN pip install --no-cache-dir \15 torch==2.5.1 \16 torchaudio==2.5.1 \17 torchvision==0.20.118 19COPY requirements.txt .20RUN pip install --no-cache-dir -r requirements.txt21 22# Pre-download whisperx model (public repo, no token needed)23# This avoids 429 rate limits when uvx whisperx runs at inference time24RUN python3 -c "from huggingface_hub import snapshot_download; snapshot_download('Systran/faster-whisper-large-v3', cache_dir='/tmp/hf_hub_cache')"25 26COPY . .27 28RUN useradd -m -u 1000 appuser && chown -R appuser:appuser /app29# Create shared HF cache directories30RUN mkdir -p /tmp/hf_hub_cache /tmp/whisper_cache && chown -R appuser:appuser /tmp/hf_hub_cache /tmp/whisper_cache31# Make uvx available to appuser32RUN cp /root/.local/bin/uvx /usr/local/bin/uvx 2>/dev/null || true33RUN cp /root/.local/bin/uv /usr/local/bin/uv 2>/dev/null || true34 35USER appuser36 37ENV CUDA_VISIBLE_DEVICES=""38ENV HF_TOKEN=${HF_TOKEN}39ENV TRIBE_CKPT=facebook/tribev240ENV MAX_VIDEO_DURATION=12041ENV MAX_AUDIO_DURATION=12042 43EXPOSE 786044CMD ["python", "app.py"]45 