Spaces:
Sleeping
Sleeping
| FROM python:3.10 | |
| WORKDIR /app | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y ffmpeg libsndfile1 | |
| # Install Python dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Create a non-root user | |
| RUN useradd -m -u 1000 user | |
| # Copy application code | |
| COPY . . | |
| # CRITICAL FIX: Create static directory and grant ownership to the non-root user | |
| RUN mkdir -p static && chown -R user:user /app/static && chown -R user:user /app | |
| # Switch to the non-root user | |
| USER user | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |