# Dockerfile for Hugging Face Spaces (Docker SDK) # Port 7860 is required by HF Spaces FROM python:3.11-slim # HF Spaces runs as non-root; redirect model caches to /tmp ENV HF_HOME=/tmp/huggingface ENV TORCH_HOME=/tmp/torch ENV TRANSFORMERS_CACHE=/tmp/huggingface ENV MODEL_PATH=/app/models/best_model.pt ENV FRONTEND_DIR=/app/frontend WORKDIR /app # Install system deps RUN apt-get update && apt-get install -y --no-install-recommends \ libsndfile1 \ ffmpeg \ && rm -rf /var/lib/apt/lists/* # Install Python deps COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy source COPY backend/ ./backend/ COPY frontend/ ./frontend/ COPY models/ ./models/ WORKDIR /app/backend EXPOSE 7860 CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]