nifty-coder/stemsplit-backend
0
1FROM python:3.10-slim2 3# Install system dependencies (ffmpeg is required for audio processing)4RUN apt-get update && apt-get install -y \5 ffmpeg \6 libsndfile1 \7 git \8 build-essential \9 && rm -rf /var/lib/apt/lists/*10 11# Set up a new user named "user" with user ID 100012RUN useradd -m -u 1000 user13 14# Switch to the "user" user15USER user16 17# Set home to the user's home directory18ENV HOME=/home/user \19 PATH=/home/user/.local/bin:$PATH20 21# Set the working directory to the user's home directory22WORKDIR $HOME/app23 24# Copy the current directory contents into the container at $HOME/app setting the owner to the user25COPY --chown=user:user . $HOME/app26 27# Install Python dependencies28RUN pip install --no-cache-dir --upgrade pip && \29 pip install --no-cache-dir -r requirements.txt30 31# Create cache directory for demucs/temp files if main.py uses usage32# main.py uses tempfile.gettempdir(), but we might want a specific cache dir if configured33# Ensuring permissions are correct is handled by the user switch above34 35# Expose port 7860 for Hugging Face Spaces36EXPOSE 786037 38# Run the application39# CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]40CMD ["python", "main.py"]