Spaces:
Running
Running
File size: 999 Bytes
2986566 9a04092 3f04c85 ca02259 c89739f 9a04092 2986566 01c6383 2986566 ca24438 b55f886 2986566 01c6383 2986566 ca02259 01c6383 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# Use an official Python runtime as a parent image
FROM python:3.9-slim
# Set environment variables for Hugging Face cache
ENV TRANSFORMERS_CACHE=/tmp/.cache
ENV HF_DATASETS_CACHE=/tmp/.cache
# Set PyTorch cache directory
ENV TORCH_HOME=/tmp/.cache
# Create the cache directory and set permissions
RUN mkdir -p /tmp/.cache && chmod -R 777 /tmp/.cache
# Set the working directory in the container
WORKDIR /app
# Install system dependencies (required for soundfile and other libraries)
RUN apt-get update && apt-get install -y \
libsndfile1 \
&& rm -rf /var/lib/apt/lists/*
# Copy the requirements file into the container
COPY requirements.txt .
# Upgrade pip to the latest version
RUN pip install --upgrade pip
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the current directory contents into the container
COPY . .
# Expose port 7860 (default port for Gradio)
EXPOSE 7860
# Run the app when the container launches
CMD ["python", "app.py"] |