Spaces:
Running
Running
| FROM python:3.10-slim | |
| # Install system dependencies for audio and phonemization | |
| RUN apt-get update && apt-get install -y \ | |
| ffmpeg \ | |
| libsndfile1 \ | |
| espeak-ng \ | |
| build-essential \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Set up a non-root user (Hugging Face Requirement) | |
| RUN useradd -m -u 1000 user | |
| WORKDIR /app | |
| # Switch to user context | |
| USER user | |
| ENV PATH="/home/user/.local/bin:${PATH}" | |
| # Install Python requirements | |
| COPY --chown=user requirements.txt . | |
| RUN pip install --no-cache-dir --user -r requirements.txt | |
| RUN pip install 'markitdown[all]' | |
| # Copy your application code | |
| COPY --chown=user . . | |
| # Expose port 7860 for HF Spaces | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |