Spaces:
Running
Running
# Use a lightweight Python base image with PyTorch | |
FROM python:3.10-slim | |
# Install ffmpeg, libsndfile, and other system dependencies | |
RUN apt-get update && apt-get install -y ffmpeg libsndfile1 && apt-get clean | |
# Set working directory | |
WORKDIR /app | |
# Create a cache directory and set permissions | |
RUN mkdir -p /app/cache && chmod -R 777 /app/cache | |
# Set environment variable for Hugging Face cache | |
ENV HF_HOME=/app/cache | |
# Copy requirements and install dependencies | |
COPY requirements.txt . | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Copy the application code | |
COPY . . | |
# Expose port for the API | |
EXPOSE 7860 | |
# Command to run the application | |
CMD ["python", "app.py"] |