Spaces:
Sleeping
Sleeping
| # Use an official Python runtime as a parent image | |
| FROM python:3.10-slim | |
| # Set the working directory | |
| WORKDIR /code | |
| # Install system dependencies for audio processing | |
| RUN apt-get update && apt-get install -y \ | |
| ffmpeg \ | |
| libsndfile1 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy requirements and install Python dependencies | |
| COPY requirements.txt ./ | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy the rest of the application code | |
| COPY . . | |
| # Expose the port Spaces expects | |
| EXPOSE 7860 | |
| # Set cache directories to avoid permission errors (use /tmp for Docker Spaces) | |
| ENV TRANSFORMERS_CACHE=/tmp/transformers_cache | |
| ENV HF_HOME=/tmp/huggingface | |
| # Run the FastAPI app with uvicorn | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |