Spaces:
Sleeping
Sleeping
| FROM python:3.10-slim | |
| # ββ System deps ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| RUN apt-get update && apt-get install -y \ | |
| ffmpeg git curl \ | |
| && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /app | |
| # ββ Upgrade pip + fix typing-extensions before torch ββββββββββββββββββββββββββ | |
| RUN pip install --no-cache-dir --upgrade pip "typing-extensions>=4.10.0" | |
| # ββ PyTorch CPU (needed by faster-whisper / transformers) βββββββββββββββββββββ | |
| RUN pip install --no-cache-dir "torch>=2.6.0" torchaudio \ | |
| --index-url https://download.pytorch.org/whl/cpu | |
| # ββ Core app deps ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| RUN pip install --no-cache-dir \ | |
| fastapi uvicorn \ | |
| requests httpx \ | |
| python-multipart aiofiles \ | |
| groq \ | |
| deep-translator transformers tokenizers \ | |
| huggingface_hub sentencepiece sacremoses \ | |
| soundfile numpy \ | |
| librosa ffmpeg-python faster-whisper \ | |
| cloudinary \ | |
| cleanvoice-sdk | |
| COPY . . | |
| # ββ Fix cache dir permissions before switching user ββββββββββββββββββββββββββββ | |
| RUN mkdir -p /app/.cache/huggingface && chown -R 1000:1000 /app | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV HF_HOME=/app/.cache/huggingface | |
| ENV TRANSFORMERS_CACHE=/app/.cache/huggingface | |
| ENV HOME=/home/user | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |