Spaces:
Running
Running
| FROM nvidia/cuda:12.4.0-devel-ubuntu22.04 | |
| # Set environment variables | |
| ENV PYTHONDONTWRITEBYTECODE=1 | |
| ENV PYTHONUNBUFFERED=1 | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| libsndfile1 \ | |
| ffmpeg \ | |
| python3 \ | |
| python3-pip \ | |
| python3-dev \ | |
| && apt-get clean \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Set up a new user named "user" with user ID 1000 | |
| RUN useradd -m -u 1000 user | |
| # Switch to the "user" user | |
| USER user | |
| # Set up working directory | |
| WORKDIR /app | |
| # Install Python dependencies | |
| COPY requirements.txt . | |
| RUN pip3 install --no-cache-dir -r requirements.txt | |
| # Copy application code | |
| COPY . . | |
| # Create required directories | |
| RUN mkdir -p model_cache reference_audio outputs | |
| # Expose the port the application will run on (default to 8003 as per config) | |
| EXPOSE 8003 | |
| # Command to run the application | |
| CMD ["python3", "server.py"] |