Spaces:
Paused
Paused
# Base image | |
FROM python:3.10-slim | |
# Install system packages | |
RUN apt-get update && apt-get install -y \ | |
git \ | |
ffmpeg \ | |
libsndfile1 \ | |
&& apt-get clean | |
# Set working directory | |
WORKDIR /app | |
# Copy all project files | |
COPY . . | |
# Upgrade pip | |
RUN pip install --upgrade pip | |
# Install dependencies with CPU-only PyTorch | |
RUN pip install --extra-index-url https://download.pytorch.org/whl/cpu -r requirements.txt | |
# Set cache dir for Hugging Face models to avoid /.cache permission errors | |
ENV TRANSFORMERS_CACHE=/app/cache/huggingface | |
ENV HF_HOME=/app/cache/huggingface | |
# Expose port | |
EXPOSE 7860 | |
# Start the Flask app | |
CMD ["python", "app.py"] | |